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

[8.x] [Automatic Import] Fix missing ecs mappings (#209057) #209085

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

kibanamachine
Copy link
Contributor

Backport

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

Questions ?

Please refer to the Backport tool documentation

## Summary

Fix missing ecs mappings.

## Details

If the input is of a multilevel json where there were no ecs mappings
identified on first level, For ex:

```
{
  okta_test: {
    audit: {
      actor: [Object],
      authenticationContext: [Object],
      client: [Object],
      debugContext: [Object],
      displayMessage: [Object],
      eventType: [Object],
      legacyEventType: null,
      outcome: [Object],
      published: [Object],
      request: [Object],
      securityContext: [Object],
      severity: [Object],
      target: null,
      transaction: [Object],
      uuid: [Object],
      version: null
    }
  }
}
```

Then there is no `target` field identified and an iteration is triggered
to find the ecs mappings in the next level. Since there is no `target`
identified the logic exited and further levels were skipped in
identifying the mappings.

This PR fixes it and skips handling of Arrays since `rename` processor
cannot flatten arrays on its own to map searchable fields. This will
handled separately.

(cherry picked from commit 2fe3976)
@kibanamachine kibanamachine force-pushed the backport/8.x/pr-209057 branch from 4413138 to 4de77f7 Compare January 31, 2025 11:38
@kibanamachine kibanamachine merged commit 804eb8e into elastic:8.x Jan 31, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants