SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
parser updated to support more than one contains
nityanandagohain294d527a0e33
diff --git a/pkg/query-service/app/logs/parser.go b/pkg/query-service/app/logs/parser.goindex fb819337ce..ec1fb773d4 100644--- a/pkg/query-service/app/logs/parser.go+++ b/pkg/query-service/app/logs/parser.go@@ -31,7 +31,7 @@ const (IDEND = "idEnd")-var tokenRegex, _ = regexp.Compile(`(?i)(and( )*?)?(([\w.-]+ (in|nin) \([\S ]+\))|([\w.]+ (gt|lt|gte|lte) (')?[\S]+(')?)|([\w.]+ (contains|ncontains)) (')?[\S ]+(')?)`)+var tokenRegex, _ = regexp.Compile(`(?i)(and( )*?)?(([\w.-]+ (in|nin) \([\S ]+\))|([\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) {diff --git a/pkg/query-service/app/logs/parser_test.go b/pkg/query-service/app/logs/parser_test.goindex 84984acb3b..517247122e 100644--- a/pkg/query-service/app/logs/parser_test.go+++ b/pkg/query-service/app/logs/parser_test.go@@ -32,6 +32,11 @@ var correctQueriesTest = []struct {`resource contains 'Hello, "World"'`,[]string{`resource ILIKE '%Hello, "World"%' `},},+ {+ `more than one continas`,+ `resource contains 'Hello, "World"' and myresource contains 'abcd'`,+ []string{`resource ILIKE '%Hello, "World"%' `, `AND myresource ILIKE '%abcd%' `},+ },{`filters with lt,gt,lte,gte operators`,`id lt 100 and id gt 50 and code lte 500 and code gte 400`,