mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 03:39:02 +08:00
fix: parser updated to support escaped quotes in search (#1704)
Co-authored-by: Palash Gupta <palashgdev@gmail.com>
This commit is contained in:
parent
9735a6e5ce
commit
a3b03ef0ca
@ -36,7 +36,7 @@ const (
|
||||
DESC = "desc"
|
||||
)
|
||||
|
||||
var tokenRegex, _ = regexp.Compile(`(?i)(and( )*?|or( )*?)?(([\w.-]+ (in|nin) \([^(]+\))|([\w.]+ (gt|lt|gte|lte) (')?[\S]+(')?)|([\w.]+ (contains|ncontains)) '[^']+')`)
|
||||
var tokenRegex, _ = regexp.Compile(`(?i)(and( )*?|or( )*?)?(([\w.-]+ (in|nin) \([^(]+\))|([\w.]+ (gt|lt|gte|lte) (')?[\S]+(')?)|([\w.]+ (contains|ncontains)) [^\\]?'(.*?[^\\])')`)
|
||||
var operatorRegex, _ = regexp.Compile(`(?i)(?: )(in|nin|gt|lt|gte|lte|contains|ncontains)(?: )`)
|
||||
|
||||
func ParseLogFilterParams(r *http.Request) (*model.LogsFilterParams, error) {
|
||||
|
@ -29,8 +29,8 @@ var correctQueriesTest = []struct {
|
||||
},
|
||||
{
|
||||
`contains search with a different attributes`,
|
||||
`resource contains 'Hello, "World"'`,
|
||||
[]string{`resource ILIKE '%Hello, "World"%' `},
|
||||
`resource contains 'Hello, "World" and user\'s'`,
|
||||
[]string{`resource ILIKE '%Hello, "World" and user\'s%' `},
|
||||
},
|
||||
{
|
||||
`more than one continas`,
|
||||
|
Loading…
x
Reference in New Issue
Block a user