# Logstash Array of JSON

**URL:** <https://discuss.elastic.co/t/logstash-array-of-json/324178>\
**Category:** Logstash\
**Created:** [January 29, 2023, 2:05pm UTC](https://discuss.elastic.co/t/logstash-array-of-json/324178 "2023-01-29T14:05:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![creative\_sha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/creative_sha/32/116483_2.png) [@creative\_sha](https://discuss.elastic.co/u/creative_sha)\
**Post date:** [January 29, 2023, 2:05pm UTC](https://discuss.elastic.co/t/logstash-array-of-json/324178/1 "2023-01-29T14:05:39Z")

</div>

How can I Split Array of JSON into different JSON so that per request we will get 1 row?

---

<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:** [January 29, 2023, 5:47pm UTC](https://discuss.elastic.co/t/logstash-array-of-json/324178/3 "2023-01-29T17:47:35Z")

</div>

Use a [split](https://www.elastic.co/guide/en/logstash/current/plugins-filters-split.html) filter?

---

<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:** [January 30, 2023, 4:12am UTC](https://discuss.elastic.co/t/logstash-array-of-json/324178/5 "2023-01-30T04:12:23Z")

</div>

> [@creative\_sha](#):
>
> sincedb\_path =\> "NULL"

That will persist the in-memory sincedb in a file called NULL in the working directory of logstash. On Windows, if you want the sincedb reset each time logstash starts then set it to "NUL", not "NULL". (On UNIX use "/dev/null".)

It looks like your json file is pretty-printed with one key/value pair per line. You will need to combine the lines using a multiline codec (so instead of using a json codec you will need to use a json filter to parse the JSON).

You could start by reading [this](https://discuss.elastic.co/t/json-of-varying-length-and-multiline/191689/4) and [this](https://discuss.elastic.co/t/parsing-xml-log-file-with-logstash/167306/2) (yes, it's XML rather than JSON, but exactly the same method applies).

---

<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:** [January 30, 2023, 4:51am UTC](https://discuss.elastic.co/t/logstash-array-of-json/324178/8 "2023-01-30T04:51:12Z")

</div>

> [@creative\_sha](#):
>
> "multiline\_codec\_max\_lines\_reached"

How many lines are there in your file for a single JSON object? You need to set the max\_lines option on the codec if it is more than 500. (Or perhaps your pattern is wrong.) You may then need to set the max\_bytes option if your JSON is really huge.

The other tags are expected if your multiline codec is not capturing a single JSON object.

Please do not post pictures of text, just post the text. Some people cannot see pictures, they cannot be searched, and they prevent anyone copy and pasting the text to try to reproduce your issue and develop a solution.

I get that that may require extra work on your part. If you ask for help in a forum of volunteers then that is on you,.

---

<div class="post-metadata">

**Author:** ![creative\_sha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/creative_sha/32/116483_2.png) [@creative\_sha](https://discuss.elastic.co/u/creative_sha)\
**Post date:** [January 30, 2023, 5:53am UTC](https://discuss.elastic.co/t/logstash-array-of-json/324178/10 "2023-01-30T05:53:48Z")

</div>

Inside only one RequestEventList I'm getting all multiple json objects and I want one RequestEventList per object but I'm not getting.

---

<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:** [February 27, 2023, 9:14am UTC](https://discuss.elastic.co/t/logstash-array-of-json/324178/12 "2023-02-27T09:14:54Z")

</div>

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