# Logstash adding unwanted "" & \\\\n to json input

**URL:** <https://discuss.elastic.co/t/logstash-adding-unwanted-n-to-json-input/264786>\
**Category:** Logstash\
**Created:** [February 19, 2021, 4:48am UTC](https://discuss.elastic.co/t/logstash-adding-unwanted-n-to-json-input/264786 "2021-02-19T04:48:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sjaak01](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sjaak01](https://discuss.elastic.co/u/Sjaak01)\
**Post date:** [February 19, 2021, 4:48am UTC](https://discuss.elastic.co/t/logstash-adding-unwanted-n-to-json-input/264786/1 "2021-02-19T04:48:39Z")

</div>

Hi,

I have a log that I converted from plain text to json with JQ. I want to ingest this file into Elasticsearch as is. If I copy the text below add send it to Elasticsearch manually it shows up properly formatted etc.

However Logstash appears to be adding additional "" to the beginning and end thus losing all the formatting.

I tried using various input codecs and filters but none give me the desired result.

Example file  
`"TEMP:\nStart time: 2019-07-29 02:42:36\nEnd time: 2020-02-10 06:21:20\nWork time: 137 days 20 hrs 0 min\n"`

Logstash turns this into  
` "\"TEMP:\\nStart time: 2019-07-29 02:42:36\\nEnd time: 2020-02-10 06:21:20\\nWork time: 137 days 20 hrs 0 min\\n""`

edit: Found another issue. For whatever reason Logstash is replacing all the newlines `\n` with `\\n`.

---

<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:** [March 19, 2021, 4:49am UTC](https://discuss.elastic.co/t/logstash-adding-unwanted-n-to-json-input/264786/2 "2021-03-19T04:49:28Z")

</div>

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