logstash-plugins/logstash-output-tcp

should default to json_lines codec

colinsurprenant opened this issue · 6 comments

the current default codec is json https://github.com/logstash-plugins/logstash-output-tcp/blob/master/lib/logstash/outputs/tcp.rb#L17 thus transcoding a event stream into a continuous back-to-back stream of json object without delimiters. I think we should really default to the the json_lines codec, just like the tcp input defaults to the line codec.

@colinsurprenant should we continue with this for 5.0, since the breaking change can be taken advantage of?

@colinsurprenant + @talevy - Consider the changes proposed by @andrewvc regarding the [Codec replacement plan[(https://github.com/elastic/logstash/issues/5124)

What would the appropriate behaviour be for a batch? batch.map(&:to_json).join(@delimiter)
What other uses has anyone seen for this input other than the LS tcp output -> LS tcp input?

I am not sure how relevant this issue is WRT the upcoming codecs changes in 5.0. Maybe we can keep this to make sure we do output line-delimited json by default in which ever form this codec will take in the future.

I think this is solved lately. Some time ago (May 2014) elastic/logstash#1392

This is still not fixed, and the docs are inconsistent with the current behaviour (docs say "Each event json is separated by a newline.")

@tomjonandy it should be fixed per elastic/logstash#1392 as @jordansissel mentioned which automatically swaps the codec to json_lines. Please le me know if/how this is not working for you?

I am wondering why we don't actually change it here directly though?!