[Auto Import] Improve the ECS mapping extraction logic #195167
+157
−36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Release Notes
Automatic Import is more forgiving if an LLM returns an ECS mapping in a slightly unexpected format.
Summary
When implementing #194386 an issue has been encountered where Claude returns the field name
date_format
instead of expecteddate_formats
and the ECS chain breaks down.We add this case as a test to
x-pack/plugins/integration_assistant/server/graphs/ecs/validate.test
. Without the changes in this PR the list returned byfindInvalidEcsFields
iswhile with these changes the result does not contain any
Invalid ECS field
messages.The key changes are in the
processMapping
function:date_format
in lieu ofdate_formats
.0.8
.The latter change generally limits the impact of any other format issues in the ECS mapping in the future.
Additionally, the function has been renamed to
extractECSMapping
, its output type validated, and documentation has been added.Checklist