# Parse json with multiple lists to different events

**URL:** https://discuss.elastic.co/t/parse-json-with-multiple-lists-to-different-events/225987
**Category:** Logstash
**Created:** [April 1, 2020, 6:59am UTC](https://discuss.elastic.co/t/parse-json-with-multiple-lists-to-different-events/225987 "2020-04-01T06:59:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![aleixsb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aleixsb/32/65446_2.png) [@aleixsb](https://discuss.elastic.co/u/aleixsb)
#### Post date: [April 1, 2020, 6:59am UTC](https://discuss.elastic.co/t/parse-json-with-multiple-lists-to-different-events/225987/1 "2020-04-01T06:59:42Z")

</div>

Hi all,

I'm trying to parse a json I get from an API which contains several lists of objects, which I would like to parse each object of each list to a different event.

```auto
{
   "Time":"XXXXX",
   "listA":[],
   "listB":[],
   "listC":[],
   "listD":[]
}

```

I've been playing with split filter, but what I get is 1 event with one object of each list:

```auto
input {
    XXXX
}
filter {
  json {
    source => "message"
  }
  split { 
    field => "listA"
  }
  split { 
    field => "listB"
  }
}
output {
    stdout {
        codec => rubydebug
    }
}

```

result event:

```auto
{
   "@timestamp":"2020-04-01T06:52:42.224Z",
   "objectA":{},
   "objectB":{},
}

```

What I would like to get are 2 different events:

```auto
{
   "@timestamp":"2020-04-01T06:52:42.224Z",
   "objectB":{}
}

{
   "@timestamp":"2020-04-01T06:52:42.224Z",
   "objectA":{}
}

```

Any idea how can I do this?

Thanks!

---

<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: [April 1, 2020, 3:18pm UTC](https://discuss.elastic.co/t/parse-json-with-multiple-lists-to-different-events/225987/2 "2020-04-01T15:18:24Z")

</div>

> [@aleixsb](#):
>
> Any idea how can I do this?

Create an array containing the list of lists and split that, then split each array within it.

---

<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: [April 29, 2020, 3:18pm UTC](https://discuss.elastic.co/t/parse-json-with-multiple-lists-to-different-events/225987/3 "2020-04-29T15:18:27Z")

</div>

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