# Search for dinamically field name in dashboard

**URL:** <https://discuss.elastic.co/t/search-for-dinamically-field-name-in-dashboard/256713>\
**Category:** Kibana\
**Tags:** kql-kibana-query-language\
**Created:** [November 25, 2020, 8:50pm UTC](https://discuss.elastic.co/t/search-for-dinamically-field-name-in-dashboard/256713 "2020-11-25T20:50:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Philippe\_Geraldeli\_A](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/philippe_geraldeli_a/32/79719_2.png) [@Philippe\_Geraldeli\_A](https://discuss.elastic.co/u/Philippe_Geraldeli_A)\
**Post date:** [November 25, 2020, 8:50pm UTC](https://discuss.elastic.co/t/search-for-dinamically-field-name-in-dashboard/256713/1 "2020-11-25T20:50:49Z")

</div>

I'm using kibana 6.2 and because of the problem that arrays are not well supported, i changed my json like that:

```auto
    {"array1" : [
               {
                      "array2" : [
                               {"name": "abc"},{"name": "def"}
                        ]
                }
        ]
    }

```

```auto
    {"array1" : 
          "0" :
               {
                      "array2" : 
                              "0": {"name": "abc"},
                              "1": {"name": "def"}       
                }
    }

```

On my dashboard i'm trying to create a pie chart that splits into count of names, but when using terms i can't write on "field": `array1.*.array2.*.name`

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/5/d51d4b5364903a4c5d8f18e14ae28ad834dadad5.png)

I tried to use json input but with no success, and the field i want is `zapReport.site.*.alerts.*.keyword`

Another question is, which version arrays are well suported?

Someone can help me please?

---

<div class="post-metadata">

**Author:** ![Patrick\_Mueller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_mueller/32/109425_2.png) [@Patrick\_Mueller](https://discuss.elastic.co/u/Patrick_Mueller)\
**Post date:** [November 26, 2020, 4:44am UTC](https://discuss.elastic.co/t/search-for-dinamically-field-name-in-dashboard/256713/2 "2020-11-26T04:44:01Z")

</div>

There is the "nested" type, which can do what you want directly: [https://www.elastic.co/guide/en/elasticsearch/reference/master/nested.html](https://www.elastic.co/guide/en/elasticsearch/reference/master/nested.html)

You can even have "nested" fields whose fields are "nested", needed for your example.

I think the problem you'll find is that it's not supported everywhere you can create queries for use in visualizations/alerts/etc in Kibana, yet. It's supported in terms of building queries against elasticsearch though, if you just need the raw search output,

Off the top of my head (and I'm no expert at mappings!), I'd say you might want to reconsider your data model, so that you end up with multiple documents per "site". Example below. But it really depends on how you intend to access your data.

```auto
{ site: foo, alert: a }
{ site: foo, alert: b }
{ site: foo, alert: c }
{ site: bar, alert: x }
{ site: bar, alert: y }
{ site: bar, alert: z }

```

---

<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:** [December 24, 2020, 4:44am UTC](https://discuss.elastic.co/t/search-for-dinamically-field-name-in-dashboard/256713/3 "2020-12-24T04:44:09Z")

</div>

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