Skip to content

Commit 66e6241

Browse files
committed
Document the error scenario when parsing json data
Fixes #22
1 parent b5fcc27 commit 66e6241

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/logstash/filters/json.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010
# By default it will place the parsed JSON in the root (top level) of the Logstash event, but this
1111
# filter can be configured to place the JSON into any arbitrary event field, using the
1212
# `target` configuration.
13+
#
14+
# This plugin has a few fallback scenario when something bad happen during the parsing of the event.
15+
# If the JSON parsing fails on the data, the event will be untouched and it will be tagged with a
16+
# `_jsonparsefailure` then you can use conditionals to clean the data. You can configured this tag with then
17+
# `tag_on_failure` option.
18+
#
19+
# If the parsed data contains a `@timestamp` field, we will try to use it for the event's `@timestamp`, if the
20+
# parsing fails, the field will be renamed to `_@timestamp` and the event will be tagged with a
21+
# `_timestampparsefailure`.
1322
class LogStash::Filters::Json < LogStash::Filters::Base
1423

1524
config_name "json"

0 commit comments

Comments
 (0)