# Ingesting JSON Data Samples w/ Logstash

**URL:** <https://discuss.elastic.co/t/ingesting-json-data-samples-w-logstash/275185>\
**Category:** Logstash\
**Created:** [June 7, 2021, 6:18pm UTC](https://discuss.elastic.co/t/ingesting-json-data-samples-w-logstash/275185 "2021-06-07T18:18:09Z")\
**Posts on this page:** 1\
**Showing post:** 29

<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:** [June 9, 2021, 1:16am UTC](https://discuss.elastic.co/t/ingesting-json-data-samples-w-logstash/275185/29 "2021-06-09T01:16:54Z")

</div>

No, I meant on stdout. But what you posted there indicates the problem. A json codec does not keep accumulating lines until it has a complete JSON object, it parses each line as an object. What you need is a multiline code to combine all the lines for one object into a single event, then parse it using a json filter.

If you want to ingest the whole file as one event see [Merge Multiline json into single line json using codec multiline plugin - #2 by Badger](https://discuss.elastic.co/t/merge-multiline-json-into-single-line-json-using-codec-multiline-plugin/143175/2). If a file contains multiple objects then [this](https://discuss.elastic.co/t/multiline-json-file-not-ingested-with-logstash-to-elasticsearch/177144) might work.

---

_[View the full topic](https://discuss.elastic.co/t/ingesting-json-data-samples-w-logstash/275185)._
