TCP output codec json not working in Logstash (data not sending)

Hello Team,

I am using Logstash to forward events using the TCP output plugin. When I configure the output with JSON codec, data is not being sent to the receiver.

output {
tcp {
host => "hostName"
port => 1415
codec => "json"
}
}

I also tried without quotes

codec => json

My Requirement

  • I want to send structured JSON output

  • I do not want to flatten everything into one string

  • I am forwarding data over TCP

  • With codec => json, output stops working


My Question

  1. Why does codec => json in TCP output not send data?

  2. Is there any receiver-side requirement for JSON codec to work?

  3. Is there any framing / delimiter issue with JSON over TCP?

  4. What is the correct way to send proper JSON over TCP using Logstash?

The default codecon a tcp output is json, so specifying codec => json should have absolutely no effect. Just delete that line. The event will be serialized to a single line of text and a newline written as the delimiter.