{"record":{"id":"20987ccd0b5e681a","repo":"SigNoz/signoz","slug":"unsupported-operator-s","errorCode":null,"errorMessage":"unsupported operator: %s","messagePattern":"unsupported operator: (.+?)","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"pkg/query-service/app/resource/resource_query_builder.go","lineNumber":259,"sourceCode":"\t\tif logsOp, ok := resourceLogOperators[op]; ok {\n\t\t\tmembers := []string{keyName}\n\t\t\tif resolveSemconvFamilies {\n\t\t\t\tmembers = semconv.Members(semconv.KindAttribute, telemetrytypes.FieldKeySelector{\n\t\t\t\t\tName:         keyName,\n\t\t\t\t\tSignal:       telemetrytypes.SignalTraces,\n\t\t\t\t\tFieldContext: telemetrytypes.FieldContextResource,\n\t\t\t\t})\n\t\t\t}\n\t\t\t// the filter\n\t\t\tif resourceFilter := buildResourceFilter(logsOp, keyName, op, value, members); resourceFilter != \"\" {\n\t\t\t\tconditions = append(conditions, resourceFilter)\n\t\t\t}\n\t\t\t// the additional filter for better usage of the index\n\t\t\tif resourceIndexFilter := buildResourceIndexFilter(keyName, op, value, members); resourceIndexFilter != \"\" {\n\t\t\t\tconditions = append(conditions, resourceIndexFilter)\n\t\t\t}\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"unsupported operator: %s\", op)\n\t\t}\n\n\t}\n\n\treturn conditions, nil\n}\n\nfunc buildResourceFiltersFromGroupBy(groupBy []v3.AttributeKey) []string {\n\tvar conditions []string\n\n\tfor _, attr := range groupBy {\n\t\tif attr.Type != v3.AttributeKeyTypeResource {\n\t\t\tcontinue\n\t\t}\n\t\tconditions = append(conditions, fmt.Sprintf(\"(simpleJSONHas(labels, '%s') AND labels like '%%%s%%')\", attr.Key, attr.Key))\n\t}\n\treturn conditions\n}","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/app/resource/resource_query_builder.go#L241-L277","documentation":"buildResourceFiltersFromFilterItems encountered a FilterOperator that has no entry in resourceLogOperators and is therefore unsupported for resource (index) filters on logs. Only the operators mapped in resourceLogOperators can be used.","triggerScenarios":"Using an operator like regex, contains-with-casing variants, or any new/unmapped operator on a resource attribute key in a logs query filter.","commonSituations":"Custom API clients or frontend changes introduce an operator string not supported for resource keys (only body/other columns support the fuller set); typos in operator strings such as 'equal' instead of '='.","solutions":["Check resourceLogOperators in resource_query_builder.go for the supported set and use one of those operators","Move filters needing unsupported operators to body/attribute columns where they are allowed","Fix typos in the operator string (must match v3.FilterOperator constants)"],"exampleFix":"// before\nitem.Operator = \"regex\" // on a resource attribute\n\n// after\nitem.Operator = v3.FilterOperatorEqual // or filter a body attribute instead","handlingStrategy":"validation","validationCode":"const supportedResourceOps = map[v3.FilterOperator]bool{ /* mirror resourceLogOperators */ }\nif !supportedResourceOps[item.Operator] {\n    return fmt.Errorf(\"operator %s unsupported for resource keys\", item.Operator)\n}","typeGuard":"func isSupportedResourceOp(op v3.FilterOperator) bool {\n    _, ok := resourceLogOperators[op]\n    return ok\n}","tryCatchPattern":null,"preventionTips":["Advertise only supported operators per key context in the UI","Centralize operator constants instead of raw strings"],"tags":["signoz","logs","resource-filters","operator","validation"],"backgroundTag":"unsupported-filter-operator","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}