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

Reduce debug logging when sanitizing documents with multifields #2043

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Aug 27, 2024

Before this change, a debug message was printed for every multifield. Multifields can be pretty common,
specially after the introduction of ecs@mappings, what in some cases floods the logs with lines like these ones:

...
not able to add key threat.indicator.as.organization.name.text, is this a multifield?: expected map but type is string
not able to add key agent.name.text, is this a multifield?: expected map but type is string
not able to add key agent.name.text, is this a multifield?: expected map but type is string
not able to add key agent.name.text, is this a multifield?: expected map but type is string
...

With this change a single line is printed every time the method is called:

Some keys were not included in sanitized docs because the are multifields: agent.name.text, threat.indicator.as.organization.name.text, threat.indicator.url.full.text, threat.indicator.url.original.text

Other failed cases are printed at the warning level.

@jsoriano jsoriano self-assigned this Aug 27, 2024
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

cc @jsoriano

@jsoriano jsoriano requested a review from a team August 28, 2024 08:20
@jsoriano jsoriano merged commit f5d11a4 into elastic:main Aug 28, 2024
3 checks passed
@jsoriano jsoriano deleted the multifield-message branch August 28, 2024 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants