# Parse array of array in Logstash

**URL:** https://discuss.elastic.co/t/parse-array-of-array-in-logstash/224765
**Category:** Logstash
**Created:** [March 24, 2020, 5:54am UTC](https://discuss.elastic.co/t/parse-array-of-array-in-logstash/224765 "2020-03-24T05:54:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sandy1139](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@sandy1139](https://discuss.elastic.co/u/sandy1139)
#### Post date: [March 24, 2020, 5:54am UTC](https://discuss.elastic.co/t/parse-array-of-array-in-logstash/224765/1 "2020-03-24T05:54:15Z")

</div>

I have some logs like below which is an array within which there are two more arrays, I need to split them into individual events.

[{"nodes":[{"id":"node1","label":["Label1", "Label2"],"properties":"property1"},{"id":"node2","label":["Label1", "Label2"],"properties":"property2"}],"relationships":[{"id":"relation1","properties":"property1"},{"id":"relation2","properties":"property2"}]}]

Expected result:

```auto
{
	"id" => "node1"
	"label_0" => "Label1"
	"label_1" => "Label2"
	"properties" => "property1"
}
{
	"id" => "node2"
	"label_0" => "Label1"
	"label_1" => "Label2"
	"properties" => "property2"
}
{
	"id" => "relation1"
	"properties" => "property1"
}
{
	"id" => "relation2"
	"properties" => "property2"
}

```

---

<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: [March 24, 2020, 12:48pm UTC](https://discuss.elastic.co/t/parse-array-of-array-in-logstash/224765/2 "2020-03-24T12:48:51Z")

</div>

You can split that event into multiple events using a split filter. You can expand an array into multiple fields using something like [this](https://discuss.elastic.co/t/parsing-an-array-in-ruby/121254/2).

---

<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 30, 2020, 6:27am UTC](https://discuss.elastic.co/t/parse-array-of-array-in-logstash/224765/4 "2020-04-30T06:27:37Z")

</div>

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