mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
Add a trailling \n to the json encoding to keep backwards
compatibility to old behavior.
This commit is contained in:
parent
4b3c0a34af
commit
f8948bf694
1 changed files with 3 additions and 1 deletions
|
@ -14,7 +14,9 @@ class LogStash::Codecs::Json < LogStash::Codecs::Base
|
|||
|
||||
public
|
||||
def encode(data)
|
||||
@on_event.call data.to_json
|
||||
# Tack on a \n for now because previously most of logstash's JSON
|
||||
# outputs emitted one per line, and whitespace is OK in json.
|
||||
@on_event.call(data.to_json + "\n")
|
||||
end # def encode
|
||||
|
||||
end # class LogStash::Codecs::Json
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue