-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Register kubernetes field_format matcher and remove logger in Encode API #4888
Conversation
Can one of the admins verify this patch? |
93f753b
to
6ed8fdd
Compare
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.
LGTM, want to hear from @urso on the logp Err
logp.Err("Fail to format event (%v): %#v", err, event) | ||
} | ||
return serializedEvent, err | ||
return e.Format.RunBytes(event) |
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.
@urso, any opinion on this?
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.
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.
The formatter first tries to extract the fields used in the format string from the event. And only then it applies the event to the format string. One can use default values in the format string.
On error the event will be dropped (even for filebeat). That is, we have to trade excessive logging vs. 'silently' dropping events. The error can be investigated easily. Just dropping without error might confuse users potentially thinking filebeat is super unstable, just cause the configuration is not matching the event.
I checked the outputs and all but redis do log the error as err/warning/critical (depends on output and sending guarantees). I'm ok with removing the log.Err here, but then the error must be logged in the redis output. At some point we need to collect and log potentially excessive logs in a more 'sane' manner.
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.
@urso, i have logged it as per your request.
jenkins test it |
6ed8fdd
to
2a2a5fc
Compare
…API (elastic#4888) (cherry picked from commit 38aae1e)
…API (elastic#4888) (cherry picked from commit 8d188a5)
field_format
matcher was not registered. Fixing that.There was a
continue
missing when an unknown matcherFunc was invoked, causing to get nil pointer exception.Removing logger from the Encode API as the error is returned to the caller, lets leave it to the caller to decide if its an error or a graceful failure.