Skip to content

ES|QL: Validate multiple GROK patterns individually#137082

Merged
luigidellaquila merged 3 commits intoelastic:mainfrom
luigidellaquila:esql/validate_multiple_grok_patterns
Oct 24, 2025
Merged

ES|QL: Validate multiple GROK patterns individually#137082
luigidellaquila merged 3 commits intoelastic:mainfrom
luigidellaquila:esql/validate_multiple_grok_patterns

Conversation

@luigidellaquila
Copy link
Contributor

GROK now accepts multiple patterns, and composes them in a single one.
Due to the way the patterns a composed, the result could be a valid pattern, eve if single patterns are invalid.

This adds validation to the single patterns individually.

Relates to: #136750
The fix applies only to ES|QL as this is a new feature; ingest pipelines have the same problem, but it's been like that for years, so it should probably be managed separately, as a breaking change.

@elasticsearchmachine elasticsearchmachine added v9.3.0 Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) labels Oct 24, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine
Copy link
Collaborator

Hi @luigidellaquila, I've created a changelog YAML for you.

expectError(
"row a = \"foo\" | GROK a \"(?P<justification>.+)\"",
"line 1:17: Invalid GROK pattern [(?P<justification>.+)]: [undefined group option]"
"line 1:24: Invalid GROK pattern [(?P<justification>.+)]: [undefined group option]"
Copy link
Contributor

@ncordon ncordon Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the position of the errors has changed because of having a different validation, do we care about that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's intentional: before this change it pointed to the GROK command, now it points to the wrong pattern, so it's more precise.

@luigidellaquila luigidellaquila enabled auto-merge (squash) October 24, 2025 08:51
@luigidellaquila luigidellaquila merged commit b852cf9 into elastic:main Oct 24, 2025
34 checks passed
fzowl pushed a commit to voyage-ai/elasticsearch that referenced this pull request Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL >bug Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.3.0

3 participants