-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SIEM migrations] Implement ES|QL lookups and other fixes (#204960)
## Summary Adds support for ES|QL native LOOKUP JOIN operators for Splunk lookups. - Lookups import changes: - Stores the lookups files as indices using `lookup_<lookup_name>` pattern (queries fail if the name contains `-`) - Indexes the lookups content data without duplicates (supports csv and json/ndjson) - Stores the lookup index name as the resource content that is passed to the translation agent - Fixes bug with `_lookup` suffix in the names coming from Splunk: queries use the `_lookup` suffix, but files in the. lookup editor don't have it) - Lookups translation changes: - Prompt for the `inline_query` node updated to support lookups, replacing the splunk lookup name with the new Elastic lookup index name. Placeholders for missing macros/lookups are now added in this node instead of the `translate_query` node. - Prompt for ES|QL translation updated to convert LOOKUP syntax and ignore macro/lookups placeholders - Other improvements on the agent graph: - All rule migration nodes in the graph now generate a "summary" explaining the reasoning behind each decision of the LLM, they are displayed in the comments section of each rule translation. - The inline query node was moved inside the translation sub-graph since it's only needed there. - Validation now is executed without placeholders, preventing it from running all the iterations without being able to fix it. - A deterministic node was added at the end to set the translation result and ensure minimum defaults are met. - Avoid inline_query LLM calls when a prebuilt rule matched or when the Splunk query is unsupported - Avoid prebuilt_rule matching LLM calls when no prebuilt rule is retrieved from the semantic search. - Avoid integration matching LLM calls when no integration is retrieved from the semantic search. - Other fixes - Fixes bug which was setting translation `FULL` when we missed the integration and index pattern (logs-*). Changed to `PARTIAL` - Fixes bug where the description was missing for custom translated rules, we now fallback to the splunk rule title if the description is missing - Added summary comment for prebuilt rule matching ### Screenshots #### New summary comments: ##### Prebuilt rule matching: - matching ![prebuilt matching](https://github.com/user-attachments/assets/63c86cd9-f06d-4664-89db-2fa36bdff838) - not matching ![prebuilt not matching](https://github.com/user-attachments/assets/3bd6bf7b-0564-416b-9b16-700b346dd95e) ##### Query inlining summary: ![Inlining summary](https://github.com/user-attachments/assets/6bf88e61-e269-4d4b-a01f-1a009c622982) ##### Integration matching: - matching: ![integration matching](https://github.com/user-attachments/assets/a77e01d9-3a2e-4629-a575-905b6995d55d) - not matching ![integration no match](https://github.com/user-attachments/assets/ce21b0e4-e3a3-4e2c-b6d2-2114f8a7f146) ##### ES|QL translation ![translation](https://github.com/user-attachments/assets/d0dd0879-c9ce-44f3-aa44-e3b724cd5898) Needs manual translation reason: ![unsupported](https://github.com/user-attachments/assets/45fd73b2-5fc0-4504-99bd-e263c01c3a11) #### Lookups UI: ![UI](https://github.com/user-attachments/assets/c7271e47-b0a5-4b31-b5cf-d99285e108bf) Lookup index example: ![lookup index](https://github.com/user-attachments/assets/88c275b8-96dd-4770-804b-164b3e3d4f8f) Translation ![lookup translation](https://github.com/user-attachments/assets/647a6003-e930-407b-aaf2-02bc1ea95de6) #### Test data [rules.json](https://github.com/user-attachments/files/18208912/rules.json) [all_macros.json](https://github.com/user-attachments/files/18208914/all_macros.json) [lookups.zip](https://github.com/user-attachments/files/18208904/lookups.zip) (uncompress before uploading)
- Loading branch information
Showing
62 changed files
with
939 additions
and
581 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.