Skip to content

🌊 LLM-powered parsing suggestions#208777

Merged
flash1293 merged 158 commits intoelastic:mainfrom
flash1293:flash1293/llm-parsing-suggestions
Feb 20, 2025
Merged

🌊 LLM-powered parsing suggestions#208777
flash1293 merged 158 commits intoelastic:mainfrom
flash1293:flash1293/llm-parsing-suggestions

Conversation

@flash1293
Copy link
Copy Markdown
Contributor

@flash1293 flash1293 commented Jan 29, 2025

Depends on #209985

Add suggestions for grok processing:

Screenshot 2025-02-05 at 10 31 27

The logic for generating suggestions works like this:

  • Take the current sample
  • Split it into patterns based on a simple regex-based grouping replacing runs of numbers with a placeholder, runs of regular numbers with a placeholder, etc.
  • For the top 5 found groups, pass a couple messages to the LLM in parallel to come up with a grok pattern
  • Check the grok patterns whether they actually match something and don't break
  • Report the patterns that have a positive match rate

For the Generate patterns button to show in the UI, make sure a connector is configured and the license level is above basic (trial license is easiest to test with).

I did some light refactoring on the processing routes, moving the simulation bits into a separate file - no changes in this area though.

@flash1293 flash1293 changed the title wip POC: LLM-powered parsing suggestions Jan 29, 2025
@flash1293 flash1293 added the Feature:Streams This is the label for the Streams Project label Jan 30, 2025
@flash1293
Copy link
Copy Markdown
Contributor Author

@tonyghiani I think I addressed all points raised except for the advertisement of the AI feature if it's not enabled. I'm going to add that in a follow-up PR

This is how the screen looks when no suggestions could be found:
Screenshot 2025-02-18 at 17 40 18

@flash1293
Copy link
Copy Markdown
Contributor Author

You probably want to wait with another round of review until #209985 is merged (I pulled it in here and the diffs are mixed now)

@flash1293 flash1293 requested a review from a team as a code owner February 19, 2025 14:51
@flash1293 flash1293 removed the request for review from a team February 19, 2025 15:36
@flash1293
Copy link
Copy Markdown
Contributor Author

@tonyghiani should be rebased with main - there are two things missing that I will address in a follow-up:

  • Unit tests for the suggestions handler
  • CTA if no LLM connector is available, but the user has permissions to configure it

Copy link
Copy Markdown
Contributor

@tonyghiani tonyghiani left a comment

Choose a reason for hiding this comment

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

Looks good, there are some client side parts that will probably change with the state management refactor, but I'll handle that once I rebase this work into my WIP changes.

Agree on having some API test for the suggestions, there is a lot of logic going on there and having a test safety guard seems very necessary.

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Feb 19, 2025

💚 Build Succeeded

  • Buildkite Build
  • Commit: 6b3ce93
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-208777-6b3ce93ddc78

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
streamsApp 308 310 +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/streams-schema 266 268 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
streamsApp 287.4KB 293.1KB +5.7KB
Unknown metric groups

API count

id before after diff
@kbn/streams-schema 269 271 +2

History

@flash1293 flash1293 merged commit 1f35d7a into elastic:main Feb 20, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.x

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

@kibanamachine
Copy link
Copy Markdown
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:
- [streams] lifecycle - ingestion and total docs metadata (#210301)

Manual backport

To create the backport manually run:

node scripts/backport --pr 208777

Questions ?

Please refer to the Backport tool documentation

flash1293 added a commit that referenced this pull request Feb 20, 2025
# Backport

This will backport the following commits from `main` to `8.x`:
- 🌊 LLM-powered parsing suggestions
(#208777)](#208777)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
flash1293 added a commit that referenced this pull request Feb 24, 2025
This PR takes care of two follow-ups related to the LLM integration:
* Shows CTA if AI assistant can be configured, but isn't (see
#208777 (comment))
<img width="505" alt="Screenshot 2025-02-24 at 11 24 30"
src="https://github.com/user-attachments/assets/da01e782-6b02-4ec4-91ab-b46009b41e29"
/>

* Adds some tests

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
JoseLuisGJ pushed a commit to JoseLuisGJ/kibana that referenced this pull request Feb 27, 2025
This PR takes care of two follow-ups related to the LLM integration:
* Shows CTA if AI assistant can be configured, but isn't (see
elastic#208777 (comment))
<img width="505" alt="Screenshot 2025-02-24 at 11 24 30"
src="https://github.com/user-attachments/assets/da01e782-6b02-4ec4-91ab-b46009b41e29"
/>

* Adds some tests

---------

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
Depends on elastic#209985

Add suggestions for grok processing:

<img width="594" alt="Screenshot 2025-02-05 at 10 31 27"
src="https://github.com/user-attachments/assets/4b717681-aa7d-4952-a4e0-9013d9b8aaf8"
/>

The logic for generating suggestions works like this:
* Take the current sample
* Split it into patterns based on a simple regex-based grouping
replacing runs of numbers with a placeholder, runs of regular numbers
with a placeholder, etc.
* For the top 5 found groups, pass a couple messages to the LLM in
parallel to come up with a grok pattern
* Check the grok patterns whether they actually match something and
don't break
* Report the patterns that have a positive match rate

For the `Generate patterns` button to show in the UI, make sure a
connector is configured and the license level is above basic (trial
license is easiest to test with).

I did some light refactoring on the processing routes, moving the
simulation bits into a separate file - no changes in this area though.

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani01@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Mar 22, 2025
This PR takes care of two follow-ups related to the LLM integration:
* Shows CTA if AI assistant can be configured, but isn't (see
elastic#208777 (comment))
<img width="505" alt="Screenshot 2025-02-24 at 11 24 30"
src="https://github.com/user-attachments/assets/da01e782-6b02-4ec4-91ab-b46009b41e29"
/>

* Adds some tests

---------

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 ci:project-deploy-observability Create an Observability project 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.

8 participants