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.
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
Add support for parsers in filestream input #24763
Add support for parsers in filestream input #24763
Changes from all commits
4003476
9ef72eb
57f9b72
b9f93ae
097b76f
ab5df90
446cae9
0664c8b
245c625
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can/should inject a processor at the beginning? E.g. if we have filebeat collect the output of another filebeat, shall we really overwrite the existing fields with the new ones we define here, or should we make an attempt to keep the original fields from the original log file intact if they are present?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to build and apply the post processors separately? Couldn't we just ensure that the parser correctly modifies the
message
? Are there fields that must be 'set' before the post processing is run?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the fields
log.offset
,log.file.path
are set before the input merges the JSON fields with the existing fields.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the complete function body up until here I wonder, if this could be a separate parser we just append to the list of parsers? In that case the
beat.Event
could be extracted from the message directly.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens to post processing if I have multiple JSON parsers? E.g.
json => multiline => json
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, multiple post processors are added. It means that e.g. if
keys_under_root
oroverwrite_keys
is enabled for bothjson
parsers, the last parser "wins".There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm more curious what happens to the event if one has
keys_under_root
disable and one has it enabled.e.g. let's assume I have the configuration:
with this event:
then given the parsers I would assume my event will look like:
What what will actually be produced is:
Because the post processor removes
json
from the event, it is not the first one that wins, but the last one... in this case.