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

Add raw JSON to event.original if parsing fails #9361

Closed

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Dec 3, 2018

If parsing a JSON message fails Filebeat adds "error" key with the error returned by Go. This PR adds the raw message to help debugging.

Inspired by #9172

@kvch kvch added review Filebeat Filebeat needs_backport PR is waiting to be backported to other branches. labels Dec 3, 2018
@kvch kvch force-pushed the feature-filebeat-add-raw-msg-in-case-of-error branch from 68ffa4d to 704c5fa Compare December 3, 2018 16:05
@ph
Copy link
Contributor

ph commented Dec 3, 2018

@kvch I just want to clarify a thing, IIRC the current behavior on error is to take the message.Content and set it to the Fields["message"], this PR keep that flow and also copy the content of the original string into event.original is that correct?

If the above description is true, what are the advantages or copying the field to the event.original vs the current behavior?

@kvch
Copy link
Contributor Author

kvch commented Jan 16, 2019

Indeed. In hindsight, I have no idea why I have opened this PR. Closing.

@kvch kvch closed this Jan 16, 2019
@kvch kvch removed the needs_backport PR is waiting to be backported to other branches. label Feb 1, 2019
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