Skip to content

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.

fix: case sensitive selected field search fixed (#2529)

Nityananda Gohain31a89bfdb340
diff --git a/pkg/query-service/app/logs/parser.go b/pkg/query-service/app/logs/parser.go
index 18760ba972..393c418b32 100644
--- a/pkg/query-service/app/logs/parser.go
+++ b/pkg/query-service/app/logs/parser.go
@@ -173,9 +173,9 @@ func parseLogQuery(query string) ([]string, error) {
searchString := strings.TrimSpace(strings.Split(v, op)[1])
operatorRemovedTokens := strings.Split(operatorRegex.ReplaceAllString(v, " "), " ")
- searchCol := strings.ToLower(operatorRemovedTokens[0])
- if searchCol == AND || searchCol == OR {
- searchCol = strings.ToLower(operatorRemovedTokens[1])
+ searchCol := operatorRemovedTokens[0]
+ if strings.ToLower(searchCol) == AND || strings.ToLower(searchCol) == OR {
+ searchCol = operatorRemovedTokens[1]
}
col := searchCol
if strings.ToLower(searchCol) == "fulltext" {
diff --git a/pkg/query-service/app/logs/parser_test.go b/pkg/query-service/app/logs/parser_test.go
index f11419e30f..843de2725c 100644
--- a/pkg/query-service/app/logs/parser_test.go
+++ b/pkg/query-service/app/logs/parser_test.go
@@ -97,6 +97,11 @@ var correctQueriesTest = []struct {
`id.userid in (100) and id_userid gt 50`,
[]string{`id.userid IN (100) `, `and id_userid > 50 `},
},
+ {
+ `filters with case sensitive key name`,
+ `userIdentifier in ('user') and userIdentifier contains 'user'`,
+ []string{`userIdentifier IN ('user') `, `AND userIdentifier ILIKE '%user%' `},
+ },
}
func TestParseLogQueryCorrect(t *testing.T) {