[ES|QL] Enhances grok semantics extraction with onigurama regex pattern#229409
Merged
stratoula merged 2 commits intoelastic:mainfrom Jul 28, 2025
Merged
[ES|QL] Enhances grok semantics extraction with onigurama regex pattern#229409stratoula merged 2 commits intoelastic:mainfrom
stratoula merged 2 commits intoelastic:mainfrom
Conversation
Contributor
|
Pinging @elastic/kibana-esql (Team:ESQL) |
Contributor
⏳ Build in-progress, with failures
Failed CI StepsTest Failures |
bartoval
approved these changes
Jul 25, 2025
|
|
||
| // Regex for Oniguruma-style named capture groups (?<name>...) or (?'name'...) | ||
| // Oniguruma supports both `?<name>` and `?'name'` for named capture groups. | ||
| const onigurumaNamedCaptureRegex = /(?<column>\(\?<(\w+)>|\(\?'(\w+)'\)[^)]*\))/g; |
Contributor
There was a problem hiding this comment.
This is just a curiosity: is (?<column> necessary or it can be just /\(\?<(\w+)>|\(\?'(\w+)'[^)]*\)/ ? I see we look for onigurumaMatch[2] and onigurumaMatch[3], so this is my doubt
Contributor
Author
There was a problem hiding this comment.
(?...) is useful for direct named access to a specific part of a match, but is not necessary. But is useful so I will keep it
delanni
pushed a commit
to delanni/kibana
that referenced
this pull request
Aug 5, 2025
…rn (elastic#229409) ## Summary Closes elastic#229195 It enhances the grok semantics extraction taking under consideration the Oniguruma's schema. I tested it with examples from here https://www.elastic.co/guide/en/elasticsearch/reference/8.18/esql-process-data-with-dissect-and-grok.html#esql-grok-regex It is definitely covering even more cases. Does it cover everything? I am not sure. But it is def an improvement <img width="698" height="117" alt="image" src="https://github.com/user-attachments/assets/5e44fc48-4a62-4e42-9a9e-56bd7be80851" /> ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #229195
It enhances the grok semantics extraction taking under consideration the Oniguruma's schema. I tested it with examples from here https://www.elastic.co/guide/en/elasticsearch/reference/8.18/esql-process-data-with-dissect-and-grok.html#esql-grok-regex
It is definitely covering even more cases. Does it cover everything? I am not sure. But it is def an improvement
Checklist