We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When JSON decoding fails Filebeat should include the raw data in the message field.
message
filebeat.prospectors: - paths: - input.json json.keys_under_root: true json.add_error_key: true output.console.enabled: true
input.json
Hello world! {bad: json} {"hello": "world"}
ata": { "beat": "filebeat", "type": "doc", "version": "6.2.2" }, "source": "/Users/akroh/Downloads/filebeat-6.2.2-darwin-x86_64/input.json", "offset": 13, "error": { "message": "Error decoding JSON: invalid character 'H' looking for beginning of value", "type": "json" }, "beat": { "name": "macbook", "hostname": "macbook", "version": "6.2.2" } } { "@timestamp": "2018-03-08T21:52:43.891Z", "@metadata": { "beat": "filebeat", "type": "doc", "version": "6.2.2" }, "source": "/Users/akroh/Downloads/filebeat-6.2.2-darwin-x86_64/input.json", "offset": 25, "error": { "type": "json", "message": "Error decoding JSON: invalid character 'b' looking for beginning of object key string" }, "beat": { "name": "macbook", "hostname": "macbook", "version": "6.2.2" } } { "@timestamp": "2018-03-08T21:52:43.891Z", "@metadata": { "beat": "filebeat", "type": "doc", "version": "6.2.2" }, "offset": 44, "hello": "world", "source": "/Users/akroh/Downloads/filebeat-6.2.2-darwin-x86_64/input.json", "beat": { "name": "macbook", "hostname": "macbook", "version": "6.2.2" } }
The text was updated successfully, but these errors were encountered:
#6591 This should solve it. But i think if json.add_error_key is set to false, data would be lost any way. So we should add another key for raw data.
json.add_error_key
Sorry, something went wrong.
Add raw json field when unmarshaling fails (#6591)
88911e7
Add raw json to `message` field when JSON unmarshaling fails. This ensures that no data loss occurs. Fixes #6516
Fixed by #6591.
Successfully merging a pull request may close this issue.
When JSON decoding fails Filebeat should include the raw data in the
message
field.input.json
The text was updated successfully, but these errors were encountered: