Skip to content

Commit 96d1646

Browse files
committed
Document the _jsonparsefailure scenario.
Also a small wording change on charset. Fixes #10
1 parent 0c8d5df commit 96d1646

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/logstash/codecs/json.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
# This codec may be used to decode (via inputs) and encode (via outputs)
77
# full JSON messages. If you are streaming JSON messages delimited
88
# by '\n' then see the `json_lines` codec.
9-
# Encoding will result in a single JSON string.
9+
#
10+
# Encoding will result in a compact JSON representation (no line terminators or indentation)
11+
#
12+
# If this codec recieves a payload from an input that is not valid JSON, then
13+
# it will fall back to plain text and add a tag `_jsonparsefailure`. Upon a JSON
14+
# failure, the payload will be stored in the `message` field.
1015
class LogStash::Codecs::JSON < LogStash::Codecs::Base
1116
config_name "json"
1217

@@ -19,7 +24,7 @@ class LogStash::Codecs::JSON < LogStash::Codecs::Base
1924
# weird cases like this, you can set the `charset` setting to the
2025
# actual encoding of the text and Logstash will convert it for you.
2126
#
22-
# For nxlog users, you'll want to set this to "CP1252".
27+
# For nxlog users, you may to set this to "CP1252".
2328
config :charset, :validate => ::Encoding.name_list, :default => "UTF-8"
2429

2530
public

0 commit comments

Comments
 (0)