# Logstash TCP input not being processed?

**URL:** <https://discuss.elastic.co/t/logstash-tcp-input-not-being-processed/369871>\
**Category:** Logstash\
**Created:** [October 31, 2024, 10:59am UTC](https://discuss.elastic.co/t/logstash-tcp-input-not-being-processed/369871 "2024-10-31T10:59:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pselvini](https://avatars.discourse-cdn.com/v4/letter/p/ee59a6/32.png) [@pselvini](https://discuss.elastic.co/u/pselvini)\
**Post date:** [October 31, 2024, 10:59am UTC](https://discuss.elastic.co/t/logstash-tcp-input-not-being-processed/369871/1 "2024-10-31T10:59:22Z")

</div>

Hi there,  
I have a very simple pipeline in logstash:

```auto
input {
    tcp {
        port => 4560
		codec => json_lines
    }
}

output {
	stdout {
       codec => rubydebug
    }
}

```

I am sending JSON lines to Logstash from a Java application using a Logstash Appender/Encoder ([GitHub - logfellow/logstash-logback-encoder: Logback JSON encoder and appenders](https://github.com/logfellow/logstash-logback-encoder))

The JSON lines being sent are like the following:

```auto
{"app_name":"myapp","app_version":"1.0.0","hostname":"myhostname","@timestamp":"2024-10-31T11:40:53.5018744+01:00","message":"My message","thread_name":"main","level":"DEBUG","caller_class_name":"com.test.LoggingTest","caller_method_name":"testLogMessage","caller_file_name":"LoggingTest.java","caller_line_number":16}

```

Note that each line does not terminate with a newline (\n) char and I think there's no way to make the Logback Appender/Encoder add it.

At the moment Logstash is not outputting anything to stdout, though I can see that the pipeline log moves after each log message being sent via TCP.  
Is there any chance to make it work?  
I need to output to Elasticsearch but first I wanted to be sure it can process the input correctly.

thanks for any help!  
Paolo

---

<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:** [October 31, 2024, 12:22pm UTC](https://discuss.elastic.co/t/logstash-tcp-input-not-being-processed/369871/2 "2024-10-31T12:22:42Z")

</div>

> [@pselvini](#):
>
> `codec => json_lines`

Never use a json\_lines codec on a line oriented input. The codec will accumulate data until a newline shows up, but the input consumes the newlines as delimiters, so they are never passed to the codec. Change this to a json codec.

---

<div class="post-metadata">

**Author:** ![pselvini](https://avatars.discourse-cdn.com/v4/letter/p/ee59a6/32.png) [@pselvini](https://discuss.elastic.co/u/pselvini)\
**Post date:** [October 31, 2024, 1:35pm UTC](https://discuss.elastic.co/t/logstash-tcp-input-not-being-processed/369871/3 "2024-10-31T13:35:03Z")

</div>

thank you @Badger! Can't believe it was that simple! 😀
