# Logstash input json splitted by newline “\\n”

**URL:** <https://discuss.elastic.co/t/logstash-input-json-splitted-by-newline-n/342719>\
**Category:** Logstash\
**Created:** [September 11, 2023, 8:33am UTC](https://discuss.elastic.co/t/logstash-input-json-splitted-by-newline-n/342719 "2023-09-11T08:33:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomaxp13](https://avatars.discourse-cdn.com/v4/letter/t/87869e/32.png) [@tomaxp13](https://discuss.elastic.co/u/tomaxp13)\
**Post date:** [September 11, 2023, 8:33am UTC](https://discuss.elastic.co/t/logstash-input-json-splitted-by-newline-n/342719/1 "2023-09-11T08:33:45Z")

</div>

I send the bulk to logstash where the jsons are separated by a newline.  
it looks like that:

```auto
{"tenantId":"abcdefg","userSessionId":"zxxxxxxxxxxxxxx","startTime":1234,"endTime":12345,"duration":111,"internalUserId":"12345678","userType":"REAL_USER","applicationType":"WEB_APPLICATION","bounce":true,"newUser":true,"userActionCount":1,"totalErrorCount":0,"totalLicenseCreditCount":0,"matchingConversionGoalsCount":0,"ip":"0.0.0.0","browserType":"Desktop Browser","browserFamily":"Chrome","browserMajorVersion":"Chrome 116","osFamily":"Windows","osVersion":"Windows 10"}
{"tenantId":"abcdefgths","userSessionId":"xxxxxxxxxxxxxxxxxxx","startTime":1693,"endTime":16934,"duration":222,"internalUserId":"123456","userType":"REAL_USER","applicationType":"WEB_APPLICATION","bounce":true,"newUser":false,"userActionCount":1,"totalErrorCount":0,"totalLicenseCreditCount":0,"matchingConversionGoalsCount":0,"ip":"0.0.0.0","browserType":"Desktop Browser","browserFamily":"Chrome","browserMajorVersion":"Chrome 116","osFamily":"Windows","osVersion":"Windows 10"}

```

Logstash read only first line and rest is reject

My config:

```auto

input {
  http {
    host => "0.0.0.0"
    port => 5070
    codec => "json_lines"
  }
}

filter {
}

output {
  file {
# codec => rubydebug{ metadata => true}
   path => "/tmp/test.txt"
  }
   stdout {
        codec => rubydebug{ metadata => true}
    }
}

```

---

<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:** [October 9, 2023, 8:34am UTC](https://discuss.elastic.co/t/logstash-input-json-splitted-by-newline-n/342719/2 "2023-10-09T08:34:09Z")

</div>

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