# Problem with "\\n" character with tcp output plugin

**URL:** <https://discuss.elastic.co/t/problem-with-n-character-with-tcp-output-plugin/291822>\
**Category:** Logstash\
**Created:** [December 14, 2021, 3:17pm UTC](https://discuss.elastic.co/t/problem-with-n-character-with-tcp-output-plugin/291822 "2021-12-14T15:17:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lemahdois](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@lemahdois](https://discuss.elastic.co/u/lemahdois)\
**Post date:** [December 14, 2021, 3:17pm UTC](https://discuss.elastic.co/t/problem-with-n-character-with-tcp-output-plugin/291822/1 "2021-12-14T15:17:38Z")

</div>

Hello,  
on my logstash pipeline I receive logs that contain "\n" character as follows

> "message" : "aaaa\nbbbbb"

When sending this log using tcp output plugin, the destination receives the log on two lines

> aaaa  
> bbbb

Is there a way (an option) that make logstash send this like a single line  
any input will help  
regards

---

<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 14, 2021, 5:55pm UTC](https://discuss.elastic.co/t/problem-with-n-character-with-tcp-output-plugin/291822/2 "2021-12-14T17:55:59Z")

</div>

The default codec on a tcp input is line, and the default [delimiter](https://www.elastic.co/guide/en/logstash/current/plugins-codecs-line.html#plugins-codecs-line-delimiter) for that codec is \n.

If you want to use a different delimiter then set the codec in the input and specify the delimiter option on it.

tcp is a stream oriented protocol, not message oriented. The data must be delimited to create messages.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 11, 2022, 5:56pm UTC](https://discuss.elastic.co/t/problem-with-n-character-with-tcp-output-plugin/291822/3 "2022-01-11T17:56:08Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
