# Dealing with array data

**URL:** https://discuss.elastic.co/t/dealing-with-array-data/32703
**Category:** Kibana
**Created:** [October 21, 2015, 5:17pm UTC](https://discuss.elastic.co/t/dealing-with-array-data/32703 "2015-10-21T17:17:48Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ktwo](https://avatars.discourse-cdn.com/v4/letter/k/bc8723/32.png) [@ktwo](https://discuss.elastic.co/u/ktwo)
#### Post date: [October 21, 2015, 5:17pm UTC](https://discuss.elastic.co/t/dealing-with-array-data/32703/1 "2015-10-21T17:17:48Z")

</div>

I'm new to Kibana and have an issue I'm trying to resolve.

I have some JSON that is similiar to the following:

```
"service": {
{
"protocol": "tcp",
"port": "80",
"address": "127.0.0.1"
},
{
"protocol": "tcp",
"port": "80",
"address": "192.168.0.1"
},
{
"protocol": "tcp",
"port": "80",
"address": "172.16.0.1"
}
}

```

It's my understanding that Kibana 4 doesn't support arrays so that data is displayed in Kibana as one big string value under the "service" key. I need to be able to use the "address" field for visualizations and other analytics so I modified the script that parses the source data to add an index field for each instance. For example:

```
"service": {
"0": {
"protocol": "tcp",
"port": "80",
"address": "127.0.0.1"
},
"1": {
"protocol": "tcp",
"port": "80",
"address": "192.168.0.1"
},
"2": {
"protocol": "tcp",
"port": "80",
"address": "172.16.0.1"
}
}

```

Now I have unique fields like "service.0.address" which is good, but I want to visualize in a data table. Is there anyway to use wildcards in a filter or something that would effectively merge the values into one table? For example, I'd like to display the top 10 addresses found in ANY "service.\*.address" field given that the same address value could be located in any one of the address keys.

---

<div class="post-metadata">

### Author: ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)
#### Post date: [October 27, 2015, 5:23pm UTC](https://discuss.elastic.co/t/dealing-with-array-data/32703/2 "2015-10-27T17:23:31Z")

</div>

First off, the value for the "service" key in your example is an object, not an array. I'm assuming that's a typo, but if not it might change things a bit.

That said, you should be able to do a terms aggregation on the inner objects. For example, I have some documents here with inner objects under a "relatedContent" key:

 ![](https://us1.discourse-cdn.com/elastic/original/2X/d/df801712a5c7c4e3ab2f46ae28c850fb9778edbc.png)

I can see the top 10 values for relatedContent.url by creating a data table with a terms aggregation on that sub-field:

 ![](https://us1.discourse-cdn.com/elastic/original/2X/3/3293a92ba00be6625ec003d8c8f6f2cdf29c9e2f.png)

Let me know how that works for you.

---

<div class="post-metadata">

### Author: ![ktwo](https://avatars.discourse-cdn.com/v4/letter/k/bc8723/32.png) [@ktwo](https://discuss.elastic.co/u/ktwo)
#### Post date: [October 28, 2015, 1:47pm UTC](https://discuss.elastic.co/t/dealing-with-array-data/32703/3 "2015-10-28T13:47:34Z")

</div>

Thanks! I was able to get that to work. I could have sworn I tried that numerous times but was only getting the Count column and not the count of individual values.

Thanks again,  
ktwo

---

<div class="post-metadata">

### Author: ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)
#### Post date: [October 28, 2015, 2:11pm UTC](https://discuss.elastic.co/t/dealing-with-array-data/32703/4 "2015-10-28T14:11:19Z")

</div>

Awesome, glad it worked!

---

<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: [July 6, 2017, 2:10pm UTC](https://discuss.elastic.co/t/dealing-with-array-data/32703/5 "2017-07-06T14:10:32Z")

</div>


