Add a trailling \n to the json encoding to keep backwards

compatibility to old behavior.
This commit is contained in:
Jordan Sissel 2013-08-24 22:31:19 -07:00
parent 4b3c0a34af
commit f8948bf694

View file

@ -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