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

**URL:** <https://discuss.elastic.co/t/tcp-output-codec-json-not-working-in-logstash-data-not-sending/383927>\
**Category:** Logstash\
**Created:** [December 9, 2025, 1:04pm UTC](https://discuss.elastic.co/t/tcp-output-codec-json-not-working-in-logstash-data-not-sending/383927 "2025-12-09T13:04:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![powary1415](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@powary1415](https://discuss.elastic.co/u/powary1415)\
**Post date:** [December 9, 2025, 1:04pm UTC](https://discuss.elastic.co/t/tcp-output-codec-json-not-working-in-logstash-data-not-sending/383927/1 "2025-12-09T13:04:12Z")

</div>

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**?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [December 9, 2025, 8:08pm UTC](https://discuss.elastic.co/t/tcp-output-codec-json-not-working-in-logstash-data-not-sending/383927/2 "2025-12-09T20:08:39Z")

</div>

The [default codec](https://github.com/logstash-plugins/logstash-output-tcp/blob/e32bd16a1d96cd0bc821fa4b93149934050f4040/lib/logstash/outputs/tcp.rb#L18)on 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.
