Skip to content

[streamlang] contains, startsWith and endsWith are not translated to valid esql #241341

@klacabane

Description

@klacabane

The following contains filter produces an invalid esql query:

{
	"filter": {
		"field": "resource.attributes.service.name",
		"contains": "synth-service-2"
	}
}

--->

FROM logs,logs.*
      | WHERE LIKE(`resource.attributes.service.name`, "%synth-service-2%")

While the output is expected to be

FROM logs,logs.*
      | WHERE resource.attributes.service.name LIKE "*synth-service-2*"

This issue applies to contains, startsWith and endsWith

Relevant code https://github.com/elastic/kibana/blob/main/x-pack/platform/packages/shared/kbn-streamlang/src/transpilers/esql/condition_to_esql.ts#L97-L114

Metadata

Metadata

Assignees

Labels

Feature:StreamsThis is the label for the Streams ProjectTeam:obs-ux-logsObservability Logs User Experience TeambugFixes for quality problems that affect the customer experience

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions