mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 08:16:39 +00:00
add id to request log search
This commit is contained in:
@@ -21,7 +21,7 @@ type AccessLogFilter struct {
|
|||||||
PageSize int
|
PageSize int
|
||||||
|
|
||||||
// Filtering parameters
|
// Filtering parameters
|
||||||
Search *string // General search across host, path, source IP, and user fields
|
Search *string // General search across log ID, host, path, source IP, and user fields
|
||||||
SourceIP *string // Filter by source IP address
|
SourceIP *string // Filter by source IP address
|
||||||
Host *string // Filter by host header
|
Host *string // Filter by host header
|
||||||
Path *string // Filter by request path (supports LIKE pattern)
|
Path *string // Filter by request path (supports LIKE pattern)
|
||||||
|
|||||||
@@ -5105,8 +5105,8 @@ func (s *SqlStore) applyAccessLogFilters(query *gorm.DB, filter accesslogs.Acces
|
|||||||
if filter.Search != nil {
|
if filter.Search != nil {
|
||||||
searchPattern := "%" + *filter.Search + "%"
|
searchPattern := "%" + *filter.Search + "%"
|
||||||
query = query.Where(
|
query = query.Where(
|
||||||
"location_connection_ip LIKE ? OR host LIKE ? OR path LIKE ? OR CONCAT(host, path) LIKE ? OR user_id IN (SELECT id FROM users WHERE email LIKE ? OR name LIKE ?)",
|
"id LIKE ? OR location_connection_ip LIKE ? OR host LIKE ? OR path LIKE ? OR CONCAT(host, path) LIKE ? OR user_id IN (SELECT id FROM users WHERE email LIKE ? OR name LIKE ?)",
|
||||||
searchPattern, searchPattern, searchPattern, searchPattern, searchPattern, searchPattern,
|
searchPattern, searchPattern, searchPattern, searchPattern, searchPattern, searchPattern, searchPattern,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6393,7 +6393,7 @@ paths:
|
|||||||
name: search
|
name: search
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
description: General search across host, path, source IP, user email, and user name
|
description: General search across request ID, host, path, source IP, user email, and user name
|
||||||
- in: query
|
- in: query
|
||||||
name: source_ip
|
name: source_ip
|
||||||
schema:
|
schema:
|
||||||
|
|||||||
Reference in New Issue
Block a user