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


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.

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