Skip to content

[8.x] [Streams] [Dedicated Grok UI] Package / highlight matched parts / suggestions (#213278)#215204

Merged
Kerry350 merged 3 commits intoelastic:8.xfrom
Kerry350:backport/8.x/pr-213278
Mar 20, 2025
Merged

[8.x] [Streams] [Dedicated Grok UI] Package / highlight matched parts / suggestions (#213278)#215204
Kerry350 merged 3 commits intoelastic:8.xfrom
Kerry350:backport/8.x/pr-213278

Conversation

@Kerry350
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

…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>
(cherry picked from commit f978350)

# Conflicts:
#	.github/CODEOWNERS
#	yarn.lock
@Kerry350 Kerry350 requested a review from kibanamachine as a code owner March 19, 2025 16:13
@Kerry350 Kerry350 added the backport This PR is a backport of another PR label Mar 19, 2025
@Kerry350 Kerry350 enabled auto-merge (squash) March 19, 2025 16:13
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
searchInferenceEndpoints 158 159 +1
streamsApp 378 379 +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

@Kerry350 Kerry350 merged commit e7d1c92 into elastic:8.x Mar 20, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants