Skip to content

[Streams] [Dedicated Grok UI] Package / highlight matched parts / suggestions#213278

Merged
Kerry350 merged 24 commits intoelastic:mainfrom
Kerry350:39-grok-ui
Mar 18, 2025
Merged

[Streams] [Dedicated Grok UI] Package / highlight matched parts / suggestions#213278
Kerry350 merged 24 commits intoelastic:mainfrom
Kerry350:39-grok-ui

Conversation

@Kerry350
Copy link
Contributor

@Kerry350 Kerry350 commented Mar 5, 2025

Summary

Closes https://github.com/elastic/streams-program/issues/170 and https://github.com/elastic/streams-program/issues/171

Reviewer notes

It's worth reading the research in https://github.com/elastic/streams-program/issues/168 to understand why certain decisions were made. Some of the resolving code is inspired by grok-js, unfortunately this wasn't something we could use directly.

The design / UX is not final. This is just a functional version. The editor is currently on the streams > enrichment page so it can be played with, this will not be merged.

There is pattern support for our ECS patterns, I have not added the legacy ones.

There will almost certainly be some edge cases that don't work, every repo for a Grok tool I looked at had their own 😅 I've tried to test this with lots of varied examples though.

I'd recommend unticking "No extension" from the file filter to remove the pattern files.

Screenshot 2025-03-06 at 22 40 19

Possible improvements / followups

  • We could in the future expand the UI to toggle on and off certain pattern collections.

  • Ability to add custom patterns (like in our Grok debugger). This can still be achieved with (?<queue_id>[0-9A-F]{10,11}) syntax.

  • Point out when regex is invalid (right now it's silent).

  • I've copied over the patterns from the ES repo for now, with a light script to generate an object from them. There's a CLI skeleton in place if we feel we want to actually pull these from the ES repo directly. These patterns don't change often, and aren't heavy size wise.

  • Debouncing etc for processing, but I'd like to see how the final UX ends up.

Media

Screenshot

Screenshot 2025-03-13 at 14 02 53

@Kerry350 Kerry350 self-assigned this Mar 6, 2025
@Kerry350 Kerry350 added release_note:skip Skip the PR/issue when compiling release notes backport:version Backport to applied version labels Feature:Streams This is the label for the Streams Project v9.1.0 v8.19.0 labels Mar 6, 2025
@Kerry350 Kerry350 marked this pull request as ready for review March 6, 2025 12:24
@Kerry350 Kerry350 requested a review from a team as a code owner March 6, 2025 12:24
kibanamachine and others added 5 commits March 6, 2025 12:41
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/fleet --include-path /api/dashboards --update'
@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod bot requested a review from a team as a code owner March 6, 2025 13:02
Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

This is great work - it's pretty complex to get such a thing to work reliably, but I think you made good choices to get it working in a clean way.

There is one part I'm not sure about, left a comment in the code.

Some higher level questions - you might want to tackle that on a follow-up PR but it wasn't called out explicitly so just brain dumping here:

  • It seems like the current logic to do the highlighting doesn't know about which part of the highlight corresponds to which extracted value (or whether it corresponds to an extracted value at all or is just part of the pattern). What's the plan for that? At first I thought "oh that's very simple, just search for the first occurrence of the extracted value", but that might not be the right one if the same value gets extracted into multiple places. It doesn't seem like there is a really easy way to do this in a stable fashion, do you have ideas around this already?

I've copied over the patterns from the ES repo for now, with a light script to generate an object from them

  • At least for the autocomplete, we probably shouldn't show all of the patterns. A lot are probably irrelevant by now (who is still using nagios?) and would be more confusing than helpful for the average users. At least we should order them in a way to put the most common ones to the top.

// Will match %{subPattern} or %{subPattern:fieldName}
const SUBPATTERNS_REGEX = /%\{[A-Z0-9_]+(?::[A-Za-z0-9_]+)?(?::[A-Za-z]+)?\}/g;

const NESTED_FIELD_NAMES_REGEX =
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm really scared of the day I need to fix a bug in here - could we add more explanatory comments to this and the parser?

Alternatively, have you looked into using a library like https://github.com/DmitrySoshnikov/regexp-tree instead of implementing it yourself? Might be a bit easier to maintain that way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can add more comments for sure 👍

I didn't look at using something like regexp-tree or ASTs in general, but I could look into it. I took a lot of inspiration from Grok Debugger and Grok Constructor and both just leaned on an approach like this, but I can certainly have a look at the library you've linked.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense, if it's a good fit it might be worth it.

@Kerry350
Copy link
Contributor Author

@flash1293 Thanks for reviewing.

It seems like the current logic to do the highlighting doesn't know about which part of the highlight corresponds to which extracted value (or whether it corresponds to an extracted value at all or is just part of the pattern). What's the plan for that? At first I thought "oh that's very simple, just search for the first occurrence of the extracted value", but that might not be the right one if the same value gets extracted into multiple places. It doesn't seem like there is a really easy way to do this in a stable fashion, do you have ideas around this already?

Yeah, so for the highlighting it's basically a case of "does this line match this pattern in a continuous way", and this mirrors the other Grok tools that I looked at. Values are tracked in the sense of the named fields (via capture groups and the fields property), and this becomes part of the structured output. But I haven't tracked each unique part of the highlight. Are you thinking this would be necessary for something in particular? Sorry if I've misunderstood this, this might be the part we need a call for 😁

At least for the autocomplete, we probably shouldn't show all of the patterns. A lot are probably irrelevant by now (who is still using nagios?) and would be more confusing than helpful for the average users. At least we should order them in a way to put the most common ones to the top.

Yeah, we can remove ones we don't think are needed. And I can add an order / weight to them.

@flash1293
Copy link
Contributor

Are you thinking this would be necessary for something in particular

Maybe we need to chat more about the user experience with @patpscal and @LucaWintergerst - what I imagined was something where you can hover over the individual segments that are highlighted in different ways and it will tell you which part of the regex is matches (and maybe highlights both at the same time)

A bit like this on regex101.com:
Screenshot 2025-03-11 at 13 28 43

@Kerry350
Copy link
Contributor Author

Kerry350 commented Mar 11, 2025

@flash1293

Maybe we need to chat more about the user experience with @patpscal and @LucaWintergerst - what I imagined was something where you can hover over the individual segments that are highlighted in different ways and it will tell you which part of the regex is matches (and maybe highlights both at the same time)

Ah okay, I see what you mean.

It'll be quite hard to implement. I don't think it's impossible, but just much harder. With Regex 101 there is realistically just the one layer to deal with, regex itself. With Grok we are essentially dealing with the 3 layers of Grok > Oniguruma > JS Regex. We'd somehow need to map each part to the other parts (and it's likely why no current Grok tools support this). Like I say, possible, just hard. I've been thinking through today how the implementation would work. Monaco supports hover additions on ranges so that part, at least, shouldn't be a problem.

Do you mind if we defer that to a followup and once the UI / UX is nailed down a little more?

@LucaWintergerst
Copy link
Contributor

Yes, talking to Kerry last week we also discussed that it would be much more complex now and we can follow up later.

I'll leave it up to you to decide if it's better to do the harder work now or later as I can't estimate how much extra time that is.

@flash1293
Copy link
Contributor

Sure, happy to defer this - let's solve the main features first and get back to it. There's already quite some complexity in this, we don't need to frontload the hardest parts.

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Looks pretty good, thanks! The comments are super helpful with dense code like this.

Left two small comments about the suggestions.

return {
label: key,
kind: monaco.languages.CompletionItemKind.Keyword,
insertText: key + (nextCharacterIsClosingPatternBracket ? '' : '}'),
Copy link
Contributor

@flash1293 flash1293 Mar 14, 2025

Choose a reason for hiding this comment

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

I'm not sure about this - when I'm at the end of the pattern so far, I guess it's more common to add a semantic name than just moving on.

By autocompleting the } this is made harder. Maybe we should even autocomplete a generic semantic name? Like if I'm typing %{WO and accept the WORD completion, it will put %{WORD:field_<n>} (with n being the number of semantic names so far).

We could even be smart about it - if you use the SPACE pattern, then you probably don't want to give a semantic name, so we autocomplete } right away.

Wdyt?

Copy link
Contributor Author

@Kerry350 Kerry350 Mar 17, 2025

Choose a reason for hiding this comment

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

By autocompleting the } this is made harder. Maybe we should even autocomplete a generic semantic name? Like if I'm typing %{WO and accept the WORD completion, it will put %{WORD:field_} (with n being the number of semantic names so far).

Yeah, possibly. I might be missing something but I can't find a combination of these options where you can basically say "insert this, at this range, AND pull the cursor position back". So we could just omit the } entirely, but it's hard to say right now how this will be used most.

I don't agree that inserting a semantic by default is right, necessarily. Patterns without a semantic are just as valid and potentially valuable as those without. They still form a valid part of the expression, and may well be used to parse / skip parts of information but without wanting to extract them. By defaulting to adding the semantic users would have to then remove it each time they don't need, this seems more cumbersome than the opposite behaviour. (Not hard to add this one, just not sure it's better).

Not sure how the SPACE part would work accurately, as by the time you insert a space we wouldn't be offering suggestions.

// Can be used with Monaco code editor to provide suggestions.
public getSuggestionProvider = () => {
const provider: monaco.languages.CompletionItemProvider = {
triggerCharacters: ['{'],
Copy link
Contributor

Choose a reason for hiding this comment

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

Should %{ be the trigger? { is just a normal character in grok, so it could trigger at the wrong time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's kind of hard to find detailed information on how they work, but the behaviour is the same whether this is { or %{. I think we'd probably have to do a bunch of manual inspection via the text model if this becomes a problem (nothing is actually selected even if things displaying might not be necessary).

Copy link
Contributor

Choose a reason for hiding this comment

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

got it, not a blocker or anything.

@Kerry350
Copy link
Contributor Author

Kerry350 commented Mar 17, 2025

@flash1293 Thanks for the reviews.

Just an overall note on the list here: #213278 (comment), the two main parts were implemented.

I played a bit with the automatic placeholder behaviour, I'm not 100% sure it's a good thing to add by default, I think this would make more sense with something like a toggle to turn it on / off, and will defer this for now. For displaying the colour alongside the structured output I didn't actually render this out as the UI / UX is changing anyway, but the information is 100% there to render in any way we need (cc @patpscal).

@thomheymann also had a suggestion on Slack:

I wonder if Monaco allows changing the colour for each grok pattern to match the colour you use to highlight the sample. Would make it easier to correlate the two. A bit like in the screenshot where it's changing the syntax highlighting for functions based on nesting level.

This is a good suggestion, it's just a little tricky to implement. Doing this for "proper" patterns e.g. %{WORD} is easy enough, but it becomes much harder for custom named captures e.g. (?<field_name>the pattern here). The problem is the pattern can be any amount of arbitrary regex (well, at this point it's actually Oniguruma). When we "process" the custom named patterns the only thing we actually change is swapping the name for a generated ID to track them, we don't worry about the actual custom pattern too much. Then in the samples a combination of exec() and the regex d flag (which accurately tracks index positions for capture groups) makes outputting accurate highlights pretty easy. However, doing this for our expression / grok pattern itself requires being able to 100% accurately highlight the custom named captures (including all of the abritrary Oniguruma), generating an accurate regex on our end to do this is much harder (since this can be followed by a bunch of other valid arbritrary Oniguruma too). It's the same reason the hover tooltip information is simplified for the custom capture groups.

@flash1293 Unless you see any hard blockers that can't be followed up on I'd like to get this merged in as the priorities are switching to processors 👌 (I'll remove this from the enrichment page when you're okay with it).

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Thanks for looking into the potential improvements, none of them are blocking, LGTM

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
searchInferenceEndpoints 135 136 +1
streamsApp 384 385 +1
total +2

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/grok-ui - 2 +2
@kbn/object-utils 0 3 +3
total +5
Unknown metric groups

API count

id before after diff
@kbn/grok-ui - 2 +2
@kbn/object-utils 8 11 +3
total +5

ESLint disabled in files

id before after diff
@kbn/grok-ui - 1 +1

ESLint disabled line counts

id before after diff
@kbn/grok-ui - 2 +2
@kbn/object-utils 0 1 +1
total +3

Total ESLint disabled count

id before after diff
@kbn/grok-ui - 3 +3
@kbn/object-utils 0 1 +1
total +4

History

cc @Kerry350

@Kerry350 Kerry350 merged commit f978350 into elastic:main Mar 18, 2025
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/13935064664

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

You might need to backport the following PRs to 8.x:
- [scout] extend config-discovery with CI validator (#214403)
- [Inference] Inference CLI client (#214691)
- [Space time] extending Scout with perfTracker fixture (#212397)
- [Streams] Replay loghub data with synthtrace (#212120)
- [Unified search] Change codeowners to presentation team (#212855)
- SKA: Update and breakdown x-pack/.gitignore (#212341)
- Update renovate.json and remove unnecessary deps (#212214)

Manual backport

To create the backport manually run:

node scripts/backport --pr 213278

Questions ?

Please refer to the Backport tool documentation

@Kerry350
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

Kerry350 added a commit that referenced this pull request Mar 20, 2025
… / suggestions (#213278) (#215204)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Streams] [Dedicated Grok UI] Package / highlight matched parts /
suggestions (#213278)](#213278)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Kerry
Gallagher","email":"kerry.gallagher@elastic.co"},"sourceCommit":{"committedDate":"2025-03-18T22:56:58Z","message":"[Streams]
[Dedicated Grok UI] Package / highlight matched parts / suggestions
(#213278)\n\n## Summary\n\nCloses
elastic/streams-program#170
and\nhttps://github.com/elastic/streams-program/issues/171\n\n##
Reviewer notes\n\nIt's worth reading the research
in\nhttps://github.com/elastic/streams-program/issues/168 to understand
why\ncertain decisions were made. Some of the resolving code is inspired
by\n`grok-js`, unfortunately this wasn't something we could use
directly.\n\nThe design / UX is **not** final. This is just a functional
version. The\neditor is currently on the streams > enrichment page so it
can be played\nwith, this will **not** be merged.\n\nThere is pattern
support for our ECS patterns, I have not added the\nlegacy
ones.\n\nThere will almost certainly be some edge cases that don't work,
every\nrepo for a Grok tool I looked at had their own 😅 I've tried to
test this\nwith lots of varied examples though.\n\nI'd recommend
unticking \"No extension\" from the file filter to remove\nthe pattern
files.\n\n<img width=\"323\" alt=\"Screenshot 2025-03-06 at 22 40
19\"\nsrc=\"https://github.com/user-attachments/assets/5b594f5f-0b0f-4ed0-ae10-2412fcf9e31a\"\n/>\n\n##
Possible improvements / followups\n\n- We could in the future expand the
UI to toggle on and off certain\npattern collections.\n\n- Ability to
add custom patterns (like in our Grok debugger). This can\nstill be
achieved with `(?<queue_id>[0-9A-F]{10,11})` syntax.\n\n- Point out when
regex is invalid (right now it's silent).\n\n- I've copied over the
patterns from the ES repo for now, with a light\nscript to generate an
object from them. There's a CLI skeleton in place\nif we feel we want to
actually pull these from the ES repo directly.\nThese patterns don't
change often, and aren't heavy size wise.\n\n- Debouncing etc for
processing, but I'd like to see how the final UX\nends up.\n\n##
Media\n\nScreenshot\n\n![Screenshot 2025-03-06 at 11
58\n56](https://github.com/user-attachments/assets/158b2a6f-df26-490e-b9f8-63ae69625607)\n\nSimple
example\n\n\n![simple_example](https://github.com/user-attachments/assets/36f36505-eb0b-45d6-bd24-1dbef769658d)\n\nComplex
example\n\n\n![complex_example](https://github.com/user-attachments/assets/968cc935-d208-4ef0-a64d-452995dccd5e)\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"f9783504bbc9993027967c36cdcfb8d2a37bddfb","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","Feature:Streams","v9.1.0","v8.19.0"],"title":"[Streams]
[Dedicated Grok UI] Package / highlight matched parts /
suggestions","number":213278,"url":"https://github.com/elastic/kibana/pull/213278","mergeCommit":{"message":"[Streams]
[Dedicated Grok UI] Package / highlight matched parts / suggestions
(#213278)\n\n## Summary\n\nCloses
elastic/streams-program#170
and\nhttps://github.com/elastic/streams-program/issues/171\n\n##
Reviewer notes\n\nIt's worth reading the research
in\nhttps://github.com/elastic/streams-program/issues/168 to understand
why\ncertain decisions were made. Some of the resolving code is inspired
by\n`grok-js`, unfortunately this wasn't something we could use
directly.\n\nThe design / UX is **not** final. This is just a functional
version. The\neditor is currently on the streams > enrichment page so it
can be played\nwith, this will **not** be merged.\n\nThere is pattern
support for our ECS patterns, I have not added the\nlegacy
ones.\n\nThere will almost certainly be some edge cases that don't work,
every\nrepo for a Grok tool I looked at had their own 😅 I've tried to
test this\nwith lots of varied examples though.\n\nI'd recommend
unticking \"No extension\" from the file filter to remove\nthe pattern
files.\n\n<img width=\"323\" alt=\"Screenshot 2025-03-06 at 22 40
19\"\nsrc=\"https://github.com/user-attachments/assets/5b594f5f-0b0f-4ed0-ae10-2412fcf9e31a\"\n/>\n\n##
Possible improvements / followups\n\n- We could in the future expand the
UI to toggle on and off certain\npattern collections.\n\n- Ability to
add custom patterns (like in our Grok debugger). This can\nstill be
achieved with `(?<queue_id>[0-9A-F]{10,11})` syntax.\n\n- Point out when
regex is invalid (right now it's silent).\n\n- I've copied over the
patterns from the ES repo for now, with a light\nscript to generate an
object from them. There's a CLI skeleton in place\nif we feel we want to
actually pull these from the ES repo directly.\nThese patterns don't
change often, and aren't heavy size wise.\n\n- Debouncing etc for
processing, but I'd like to see how the final UX\nends up.\n\n##
Media\n\nScreenshot\n\n![Screenshot 2025-03-06 at 11
58\n56](https://github.com/user-attachments/assets/158b2a6f-df26-490e-b9f8-63ae69625607)\n\nSimple
example\n\n\n![simple_example](https://github.com/user-attachments/assets/36f36505-eb0b-45d6-bd24-1dbef769658d)\n\nComplex
example\n\n\n![complex_example](https://github.com/user-attachments/assets/968cc935-d208-4ef0-a64d-452995dccd5e)\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"f9783504bbc9993027967c36cdcfb8d2a37bddfb"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/213278","number":213278,"mergeCommit":{"message":"[Streams]
[Dedicated Grok UI] Package / highlight matched parts / suggestions
(#213278)\n\n## Summary\n\nCloses
elastic/streams-program#170
and\nhttps://github.com/elastic/streams-program/issues/171\n\n##
Reviewer notes\n\nIt's worth reading the research
in\nhttps://github.com/elastic/streams-program/issues/168 to understand
why\ncertain decisions were made. Some of the resolving code is inspired
by\n`grok-js`, unfortunately this wasn't something we could use
directly.\n\nThe design / UX is **not** final. This is just a functional
version. The\neditor is currently on the streams > enrichment page so it
can be played\nwith, this will **not** be merged.\n\nThere is pattern
support for our ECS patterns, I have not added the\nlegacy
ones.\n\nThere will almost certainly be some edge cases that don't work,
every\nrepo for a Grok tool I looked at had their own 😅 I've tried to
test this\nwith lots of varied examples though.\n\nI'd recommend
unticking \"No extension\" from the file filter to remove\nthe pattern
files.\n\n<img width=\"323\" alt=\"Screenshot 2025-03-06 at 22 40
19\"\nsrc=\"https://github.com/user-attachments/assets/5b594f5f-0b0f-4ed0-ae10-2412fcf9e31a\"\n/>\n\n##
Possible improvements / followups\n\n- We could in the future expand the
UI to toggle on and off certain\npattern collections.\n\n- Ability to
add custom patterns (like in our Grok debugger). This can\nstill be
achieved with `(?<queue_id>[0-9A-F]{10,11})` syntax.\n\n- Point out when
regex is invalid (right now it's silent).\n\n- I've copied over the
patterns from the ES repo for now, with a light\nscript to generate an
object from them. There's a CLI skeleton in place\nif we feel we want to
actually pull these from the ES repo directly.\nThese patterns don't
change often, and aren't heavy size wise.\n\n- Debouncing etc for
processing, but I'd like to see how the final UX\nends up.\n\n##
Media\n\nScreenshot\n\n![Screenshot 2025-03-06 at 11
58\n56](https://github.com/user-attachments/assets/158b2a6f-df26-490e-b9f8-63ae69625607)\n\nSimple
example\n\n\n![simple_example](https://github.com/user-attachments/assets/36f36505-eb0b-45d6-bd24-1dbef769658d)\n\nComplex
example\n\n\n![complex_example](https://github.com/user-attachments/assets/968cc935-d208-4ef0-a64d-452995dccd5e)\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"f9783504bbc9993027967c36cdcfb8d2a37bddfb"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
clintandrewhall pushed a commit to clintandrewhall/kibana that referenced this pull request Mar 20, 2025
…gestions (elastic#213278)

## Summary

Closes elastic/streams-program#170 and
elastic/streams-program#171

## Reviewer notes

It's worth reading the research in
elastic/streams-program#168 to understand why
certain decisions were made. Some of the resolving code is inspired by
`grok-js`, unfortunately this wasn't something we could use directly.

The design / UX is **not** final. This is just a functional version. The
editor is currently on the streams > enrichment page so it can be played
with, this will **not** be merged.

There is pattern support for our ECS patterns, I have not added the
legacy ones.

There will almost certainly be some edge cases that don't work, every
repo for a Grok tool I looked at had their own 😅 I've tried to test this
with lots of varied examples though.

I'd recommend unticking "No extension" from the file filter to remove
the pattern files.

<img width="323" alt="Screenshot 2025-03-06 at 22 40 19"
src="https://github.com/user-attachments/assets/5b594f5f-0b0f-4ed0-ae10-2412fcf9e31a"
/>

## Possible improvements / followups

- We could in the future expand the UI to toggle on and off certain
pattern collections.

- Ability to add custom patterns (like in our Grok debugger). This can
still be achieved with `(?<queue_id>[0-9A-F]{10,11})` syntax.

- Point out when regex is invalid (right now it's silent).

- I've copied over the patterns from the ES repo for now, with a light
script to generate an object from them. There's a CLI skeleton in place
if we feel we want to actually pull these from the ES repo directly.
These patterns don't change often, and aren't heavy size wise.

- Debouncing etc for processing, but I'd like to see how the final UX
ends up.

## Media

Screenshot

![Screenshot 2025-03-06 at 11 58
56](https://github.com/user-attachments/assets/158b2a6f-df26-490e-b9f8-63ae69625607)

Simple example


![simple_example](https://github.com/user-attachments/assets/36f36505-eb0b-45d6-bd24-1dbef769658d)

Complex example


![complex_example](https://github.com/user-attachments/assets/968cc935-d208-4ef0-a64d-452995dccd5e)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Mar 22, 2025
…gestions (elastic#213278)

## Summary

Closes elastic/streams-program#170 and
elastic/streams-program#171

## Reviewer notes

It's worth reading the research in
elastic/streams-program#168 to understand why
certain decisions were made. Some of the resolving code is inspired by
`grok-js`, unfortunately this wasn't something we could use directly.

The design / UX is **not** final. This is just a functional version. The
editor is currently on the streams > enrichment page so it can be played
with, this will **not** be merged.

There is pattern support for our ECS patterns, I have not added the
legacy ones.

There will almost certainly be some edge cases that don't work, every
repo for a Grok tool I looked at had their own 😅 I've tried to test this
with lots of varied examples though.

I'd recommend unticking "No extension" from the file filter to remove
the pattern files.

<img width="323" alt="Screenshot 2025-03-06 at 22 40 19"
src="https://github.com/user-attachments/assets/5b594f5f-0b0f-4ed0-ae10-2412fcf9e31a"
/>

## Possible improvements / followups

- We could in the future expand the UI to toggle on and off certain
pattern collections.

- Ability to add custom patterns (like in our Grok debugger). This can
still be achieved with `(?<queue_id>[0-9A-F]{10,11})` syntax.

- Point out when regex is invalid (right now it's silent).

- I've copied over the patterns from the ES repo for now, with a light
script to generate an object from them. There's a CLI skeleton in place
if we feel we want to actually pull these from the ES repo directly.
These patterns don't change often, and aren't heavy size wise.

- Debouncing etc for processing, but I'd like to see how the final UX
ends up.

## Media

Screenshot

![Screenshot 2025-03-06 at 11 58
56](https://github.com/user-attachments/assets/158b2a6f-df26-490e-b9f8-63ae69625607)

Simple example


![simple_example](https://github.com/user-attachments/assets/36f36505-eb0b-45d6-bd24-1dbef769658d)

Complex example


![complex_example](https://github.com/user-attachments/assets/968cc935-d208-4ef0-a64d-452995dccd5e)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
JoseLuisGJ pushed a commit to JoseLuisGJ/kibana that referenced this pull request Mar 24, 2025
…gestions (elastic#213278)

## Summary

Closes elastic/streams-program#170 and
elastic/streams-program#171

## Reviewer notes

It's worth reading the research in
elastic/streams-program#168 to understand why
certain decisions were made. Some of the resolving code is inspired by
`grok-js`, unfortunately this wasn't something we could use directly.

The design / UX is **not** final. This is just a functional version. The
editor is currently on the streams > enrichment page so it can be played
with, this will **not** be merged.

There is pattern support for our ECS patterns, I have not added the
legacy ones.

There will almost certainly be some edge cases that don't work, every
repo for a Grok tool I looked at had their own 😅 I've tried to test this
with lots of varied examples though.

I'd recommend unticking "No extension" from the file filter to remove
the pattern files.

<img width="323" alt="Screenshot 2025-03-06 at 22 40 19"
src="https://github.com/user-attachments/assets/5b594f5f-0b0f-4ed0-ae10-2412fcf9e31a"
/>

## Possible improvements / followups

- We could in the future expand the UI to toggle on and off certain
pattern collections.

- Ability to add custom patterns (like in our Grok debugger). This can
still be achieved with `(?<queue_id>[0-9A-F]{10,11})` syntax.

- Point out when regex is invalid (right now it's silent).

- I've copied over the patterns from the ES repo for now, with a light
script to generate an object from them. There's a CLI skeleton in place
if we feel we want to actually pull these from the ES repo directly.
These patterns don't change often, and aren't heavy size wise.

- Debouncing etc for processing, but I'd like to see how the final UX
ends up.

## Media

Screenshot

![Screenshot 2025-03-06 at 11 58
56](https://github.com/user-attachments/assets/158b2a6f-df26-490e-b9f8-63ae69625607)

Simple example


![simple_example](https://github.com/user-attachments/assets/36f36505-eb0b-45d6-bd24-1dbef769658d)

Complex example


![complex_example](https://github.com/user-attachments/assets/968cc935-d208-4ef0-a64d-452995dccd5e)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
cqliu1 pushed a commit to cqliu1/kibana that referenced this pull request Mar 31, 2025
…gestions (elastic#213278)

## Summary

Closes elastic/streams-program#170 and
elastic/streams-program#171

## Reviewer notes

It's worth reading the research in
elastic/streams-program#168 to understand why
certain decisions were made. Some of the resolving code is inspired by
`grok-js`, unfortunately this wasn't something we could use directly.

The design / UX is **not** final. This is just a functional version. The
editor is currently on the streams > enrichment page so it can be played
with, this will **not** be merged.

There is pattern support for our ECS patterns, I have not added the
legacy ones.

There will almost certainly be some edge cases that don't work, every
repo for a Grok tool I looked at had their own 😅 I've tried to test this
with lots of varied examples though.

I'd recommend unticking "No extension" from the file filter to remove
the pattern files.

<img width="323" alt="Screenshot 2025-03-06 at 22 40 19"
src="https://github.com/user-attachments/assets/5b594f5f-0b0f-4ed0-ae10-2412fcf9e31a"
/>

## Possible improvements / followups

- We could in the future expand the UI to toggle on and off certain
pattern collections.

- Ability to add custom patterns (like in our Grok debugger). This can
still be achieved with `(?<queue_id>[0-9A-F]{10,11})` syntax.

- Point out when regex is invalid (right now it's silent).

- I've copied over the patterns from the ES repo for now, with a light
script to generate an object from them. There's a CLI skeleton in place
if we feel we want to actually pull these from the ES repo directly.
These patterns don't change often, and aren't heavy size wise.

- Debouncing etc for processing, but I'd like to see how the final UX
ends up.

## Media

Screenshot

![Screenshot 2025-03-06 at 11 58
56](https://github.com/user-attachments/assets/158b2a6f-df26-490e-b9f8-63ae69625607)

Simple example


![simple_example](https://github.com/user-attachments/assets/36f36505-eb0b-45d6-bd24-1dbef769658d)

Complex example


![complex_example](https://github.com/user-attachments/assets/968cc935-d208-4ef0-a64d-452995dccd5e)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
nikita-lavrov added a commit that referenced this pull request Dec 22, 2025
## Summary
Closes #214994

This PR removes the Observability version of the `unflattenObject`
helper and updates its usages to use the `kbn-object-utils` package. It
also fixes several edge cases:
#213278 (review)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Jan 6, 2026
## Summary
Closes elastic#214994

This PR removes the Observability version of the `unflattenObject`
helper and updates its usages to use the `kbn-object-utils` package. It
also fixes several edge cases:
elastic#213278 (review)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
dej611 pushed a commit to dej611/kibana that referenced this pull request Jan 8, 2026
## Summary
Closes elastic#214994

This PR removes the Observability version of the `unflattenObject`
helper and updates its usages to use the `kbn-object-utils` package. It
also fixes several edge cases:
elastic#213278 (review)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:Streams This is the label for the Streams Project release_note:skip Skip the PR/issue when compiling release notes v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants