Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Auto Import] Ask LLM to map to non-reserved ECS fields #195168

Merged

Conversation

ilyannn
Copy link
Contributor

@ilyannn ilyannn commented Oct 5, 2024

Release Note

Automatic Import does not ask the LLM to map the fields to the reserved ECS fields anymore.

Summary

Previously we have given the LLM the whole list of ECS fields, but later failed the validation if the LLM's suggested a mapping into one of the reserved fields (like event.created). With these changes, we hide the reserved fields from the LLM when creating the prompt, so the likelihood of this happening is reduced.

We test with the Teleport integration: ai_teleport_202410051919-1.0.0.zip

@ilyannn ilyannn self-assigned this Oct 5, 2024
@ilyannn ilyannn added Feature:AutomaticImport Team:Security-Scalability Team label for Security Integrations Scalability Team release_note:fix labels Oct 5, 2024
@ilyannn ilyannn marked this pull request as ready for review October 5, 2024 16:26
@ilyannn ilyannn requested a review from a team as a code owner October 5, 2024 16:26
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-scalability (Team:Security-Scalability)

@ilyannn ilyannn added the backport:skip This commit does not require backporting label Oct 5, 2024
@ilyannn ilyannn changed the title Only map to non-reserved fields [Auto Import] Only map to non-reserved ECS fields Oct 5, 2024
@ilyannn
Copy link
Contributor Author

ilyannn commented Oct 6, 2024

@elasticmachine merge upstream

Copy link
Contributor

@bhapas bhapas left a comment

Choose a reason for hiding this comment

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

LGTM

@ilyannn ilyannn enabled auto-merge (squash) October 7, 2024 14:13
@ilyannn ilyannn added backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) and removed backport:skip This commit does not require backporting labels Oct 7, 2024
@ilyannn
Copy link
Contributor Author

ilyannn commented Oct 7, 2024

@elasticmachine merge upstream

@ilyannn ilyannn changed the title [Auto Import] Only map to non-reserved ECS fields [Auto Import] Ask LLM to map to non-reserved ECS fields Oct 7, 2024
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @ilyannn

@ilyannn ilyannn merged commit c4599e0 into elastic:main Oct 7, 2024
20 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 7, 2024
## Release Note

Automatic Import does not ask the LLM to map the fields to the reserved
ECS fields anymore.

## Summary

Previously we have given the LLM the whole list of ECS fields, but later
failed the validation if the LLM's suggested a mapping into one of the
reserved fields (like `event.created`). With these changes, we hide the
reserved fields from the LLM when creating the prompt, so the likelihood
of this happening is reduced.

We test with the Teleport integration (see GitHub).
---------

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit c4599e0)
@kibanamachine
Copy link
Contributor

💚 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

@ilyannn ilyannn deleted the auto-import/remove-reserved-ecs-fields branch October 7, 2024 17:23
kibanamachine added a commit that referenced this pull request Oct 7, 2024
… (#195288)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Auto Import] Ask LLM to map to non-reserved ECS fields
(#195168)](#195168)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Ilya
Nikokoshev","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-07T15:57:49Z","message":"[Auto
Import] Ask LLM to map to non-reserved ECS fields (#195168)\n\n##
Release Note\r\n\r\nAutomatic Import does not ask the LLM to map the
fields to the reserved \r\nECS fields anymore.\r\n\r\n##
Summary\r\n\r\nPreviously we have given the LLM the whole list of ECS
fields, but later\r\nfailed the validation if the LLM's suggested a
mapping into one of the\r\nreserved fields (like `event.created`). With
these changes, we hide the\r\nreserved fields from the LLM when creating
the prompt, so the likelihood\r\nof this happening is reduced.\r\n\r\nWe
test with the Teleport integration (see
GitHub).\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"c4599e0ade1aa259bc8ca62ed9a45af33d71816c","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","backport:prev-minor","Team:Security-Scalability","Feature:AutomaticImport"],"title":"[Auto
Import] Ask LLM to map to non-reserved ECS
fields","number":195168,"url":"https://github.com/elastic/kibana/pull/195168","mergeCommit":{"message":"[Auto
Import] Ask LLM to map to non-reserved ECS fields (#195168)\n\n##
Release Note\r\n\r\nAutomatic Import does not ask the LLM to map the
fields to the reserved \r\nECS fields anymore.\r\n\r\n##
Summary\r\n\r\nPreviously we have given the LLM the whole list of ECS
fields, but later\r\nfailed the validation if the LLM's suggested a
mapping into one of the\r\nreserved fields (like `event.created`). With
these changes, we hide the\r\nreserved fields from the LLM when creating
the prompt, so the likelihood\r\nof this happening is reduced.\r\n\r\nWe
test with the Teleport integration (see
GitHub).\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"c4599e0ade1aa259bc8ca62ed9a45af33d71816c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195168","number":195168,"mergeCommit":{"message":"[Auto
Import] Ask LLM to map to non-reserved ECS fields (#195168)\n\n##
Release Note\r\n\r\nAutomatic Import does not ask the LLM to map the
fields to the reserved \r\nECS fields anymore.\r\n\r\n##
Summary\r\n\r\nPreviously we have given the LLM the whole list of ECS
fields, but later\r\nfailed the validation if the LLM's suggested a
mapping into one of the\r\nreserved fields (like `event.created`). With
these changes, we hide the\r\nreserved fields from the LLM when creating
the prompt, so the likelihood\r\nof this happening is reduced.\r\n\r\nWe
test with the Teleport integration (see
GitHub).\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"c4599e0ade1aa259bc8ca62ed9a45af33d71816c"}}]}]
BACKPORT-->

Co-authored-by: Ilya Nikokoshev <[email protected]>
@ilyannn ilyannn added backport:prev-major Backport to (8.x, 8.18, 8.17, 8.16) the previous major branch and other branches in development and removed backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) labels Oct 7, 2024
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.15, 8.x

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

@ilyannn ilyannn added the v8.15.3 label Oct 7, 2024
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 7, 2024
## Release Note

Automatic Import does not ask the LLM to map the fields to the reserved
ECS fields anymore.

## Summary

Previously we have given the LLM the whole list of ECS fields, but later
failed the validation if the LLM's suggested a mapping into one of the
reserved fields (like `event.created`). With these changes, we hide the
reserved fields from the LLM when creating the prompt, so the likelihood
of this happening is reduced.

We test with the Teleport integration (see GitHub).
---------

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit c4599e0)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.15
8.x Cherrypick failed because the selected commit (c4599e0) is empty. It looks like the commit was already backported in #195288

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 195168

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 7, 2024
…) (#195304)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[Auto Import] Ask LLM to map to non-reserved ECS fields
(#195168)](#195168)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Ilya
Nikokoshev","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-07T15:57:49Z","message":"[Auto
Import] Ask LLM to map to non-reserved ECS fields (#195168)\n\n##
Release Note\r\n\r\nAutomatic Import does not ask the LLM to map the
fields to the reserved \r\nECS fields anymore.\r\n\r\n##
Summary\r\n\r\nPreviously we have given the LLM the whole list of ECS
fields, but later\r\nfailed the validation if the LLM's suggested a
mapping into one of the\r\nreserved fields (like `event.created`). With
these changes, we hide the\r\nreserved fields from the LLM when creating
the prompt, so the likelihood\r\nof this happening is reduced.\r\n\r\nWe
test with the Teleport integration (see
GitHub).\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"c4599e0ade1aa259bc8ca62ed9a45af33d71816c","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","backport:prev-major","v8.16.0","Team:Security-Scalability","Feature:AutomaticImport"],"title":"[Auto
Import] Ask LLM to map to non-reserved ECS
fields","number":195168,"url":"https://github.com/elastic/kibana/pull/195168","mergeCommit":{"message":"[Auto
Import] Ask LLM to map to non-reserved ECS fields (#195168)\n\n##
Release Note\r\n\r\nAutomatic Import does not ask the LLM to map the
fields to the reserved \r\nECS fields anymore.\r\n\r\n##
Summary\r\n\r\nPreviously we have given the LLM the whole list of ECS
fields, but later\r\nfailed the validation if the LLM's suggested a
mapping into one of the\r\nreserved fields (like `event.created`). With
these changes, we hide the\r\nreserved fields from the LLM when creating
the prompt, so the likelihood\r\nof this happening is reduced.\r\n\r\nWe
test with the Teleport integration (see
GitHub).\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"c4599e0ade1aa259bc8ca62ed9a45af33d71816c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195168","number":195168,"mergeCommit":{"message":"[Auto
Import] Ask LLM to map to non-reserved ECS fields (#195168)\n\n##
Release Note\r\n\r\nAutomatic Import does not ask the LLM to map the
fields to the reserved \r\nECS fields anymore.\r\n\r\n##
Summary\r\n\r\nPreviously we have given the LLM the whole list of ECS
fields, but later\r\nfailed the validation if the LLM's suggested a
mapping into one of the\r\nreserved fields (like `event.created`). With
these changes, we hide the\r\nreserved fields from the LLM when creating
the prompt, so the likelihood\r\nof this happening is reduced.\r\n\r\nWe
test with the Teleport integration (see
GitHub).\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"c4599e0ade1aa259bc8ca62ed9a45af33d71816c"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/195288","number":195288,"state":"MERGED","mergeCommit":{"sha":"04ca4b5dc32872dcfd89b3f645fc1ebbe6762392","message":"[8.x]
[Auto Import] Ask LLM to map to non-reserved ECS fields (#195168)
(#195288)\n\n# Backport\n\nThis will backport the following commits from
`main` to `8.x`:\n- [[Auto Import] Ask LLM to map to non-reserved ECS
fields\n(#195168)](https://github.com/elastic/kibana/pull/195168)\n\n<!---
Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the
[Backport
tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT
[{\"author\":{\"name\":\"Ilya\nNikokoshev\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2024-10-07T15:57:49Z\",\"message\":\"[Auto\nImport]
Ask LLM to map to non-reserved ECS fields (#195168)\\n\\n##\nRelease
Note\\r\\n\\r\\nAutomatic Import does not ask the LLM to map the\nfields
to the reserved \\r\\nECS fields
anymore.\\r\\n\\r\\n##\nSummary\\r\\n\\r\\nPreviously we have given the
LLM the whole list of ECS\nfields, but later\\r\\nfailed the validation
if the LLM's suggested a\nmapping into one of the\\r\\nreserved fields
(like `event.created`). With\nthese changes, we hide the\\r\\nreserved
fields from the LLM when creating\nthe prompt, so the likelihood\\r\\nof
this happening is reduced.\\r\\n\\r\\nWe\ntest with the Teleport
integration (see\nGitHub).\\r\\n---------\\r\\n\\r\\nCo-authored-by:
Elastic
Machine\n<[email protected]>\",\"sha\":\"c4599e0ade1aa259bc8ca62ed9a45af33d71816c\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.16.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"release_note:fix\",\"v9.0.0\",\"backport:prev-minor\",\"Team:Security-Scalability\",\"Feature:AutomaticImport\"],\"title\":\"[Auto\nImport]
Ask LLM to map to non-reserved
ECS\nfields\",\"number\":195168,\"url\":\"https://github.com/elastic/kibana/pull/195168\",\"mergeCommit\":{\"message\":\"[Auto\nImport]
Ask LLM to map to non-reserved ECS fields (#195168)\\n\\n##\nRelease
Note\\r\\n\\r\\nAutomatic Import does not ask the LLM to map the\nfields
to the reserved \\r\\nECS fields
anymore.\\r\\n\\r\\n##\nSummary\\r\\n\\r\\nPreviously we have given the
LLM the whole list of ECS\nfields, but later\\r\\nfailed the validation
if the LLM's suggested a\nmapping into one of the\\r\\nreserved fields
(like `event.created`). With\nthese changes, we hide the\\r\\nreserved
fields from the LLM when creating\nthe prompt, so the likelihood\\r\\nof
this happening is reduced.\\r\\n\\r\\nWe\ntest with the Teleport
integration (see\nGitHub).\\r\\n---------\\r\\n\\r\\nCo-authored-by:
Elastic
Machine\n<[email protected]>\",\"sha\":\"c4599e0ade1aa259bc8ca62ed9a45af33d71816c\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v9.0.0\",\"branchLabelMappingKey\":\"^v9.0.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/195168\",\"number\":195168,\"mergeCommit\":{\"message\":\"[Auto\nImport]
Ask LLM to map to non-reserved ECS fields (#195168)\\n\\n##\nRelease
Note\\r\\n\\r\\nAutomatic Import does not ask the LLM to map the\nfields
to the reserved \\r\\nECS fields
anymore.\\r\\n\\r\\n##\nSummary\\r\\n\\r\\nPreviously we have given the
LLM the whole list of ECS\nfields, but later\\r\\nfailed the validation
if the LLM's suggested a\nmapping into one of the\\r\\nreserved fields
(like `event.created`). With\nthese changes, we hide the\\r\\nreserved
fields from the LLM when creating\nthe prompt, so the likelihood\\r\\nof
this happening is reduced.\\r\\n\\r\\nWe\ntest with the Teleport
integration (see\nGitHub).\\r\\n---------\\r\\n\\r\\nCo-authored-by:
Elastic
Machine\n<[email protected]>\",\"sha\":\"c4599e0ade1aa259bc8ca62ed9a45af33d71816c\"}}]}]\nBACKPORT-->\n\nCo-authored-by:
Ilya Nikokoshev <[email protected]>"}}]}] BACKPORT-->

Co-authored-by: Ilya Nikokoshev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-major Backport to (8.x, 8.18, 8.17, 8.16) the previous major branch and other branches in development Feature:AutomaticImport release_note:fix Team:Security-Scalability Team label for Security Integrations Scalability Team v8.15.3 v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants