# Nested query in Kibana

**URL:** <https://discuss.elastic.co/t/nested-query-in-kibana/131125>\
**Category:** Kibana\
**Created:** [May 9, 2018, 8:20am UTC](https://discuss.elastic.co/t/nested-query-in-kibana/131125 "2018-05-09T08:20:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Invictus](https://avatars.discourse-cdn.com/v4/letter/i/bc79bd/32.png) [@Invictus](https://discuss.elastic.co/u/Invictus)\
**Post date:** [May 9, 2018, 8:20am UTC](https://discuss.elastic.co/t/nested-query-in-kibana/131125/1 "2018-05-09T08:20:22Z")

</div>

Hi members,

I have a problem concerning an visualization.

dockerelk\_elasticsearch-master\_2  
dockerelk\_kibana\_1  
dockerelk\_elasticsearch-master\_1  
elasticsearch-coordinating  
dockerelk\_metricbeat\_1  
dockerelk\_elasticsearch\_3  
dockerelk\_elasticsearch\_2  
dockerelk\_logstash\_1  
dockerelk\_elasticsearch\_1

0.033  
0.011  
0.036  
0.045  
0.002  
0.205  
0.207  
0.065  
0.199  
SUM 0.81

So that are my containers with the memory %. And in the visualization table it is quiet easy to sum all entries.

Now I want the SUM 0.81% in a several visualization gauge.  
So I have tried several things but I dont now how to say:  
Get from all Container.names the Max Memory.usage.pct and build the total sum and visualize it as gauge

Has someone a solution? Thanks for advice.

---

<div class="post-metadata">

**Author:** ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)\
**Post date:** [May 9, 2018, 2:06pm UTC](https://discuss.elastic.co/t/nested-query-in-kibana/131125/2 "2018-05-09T14:06:30Z")

</div>

@thomasneirynck do we support nested queries?

Thanks,  
Bhavya

---

<div class="post-metadata">

**Author:** ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)\
**Post date:** [May 9, 2018, 3:36pm UTC](https://discuss.elastic.co/t/nested-query-in-kibana/131125/3 "2018-05-09T15:36:26Z")

</div>

hi @Invictus,

That sum in the table is calculated by Kibana and not be Elasticsearch.

Can you express that total sum using a Sum-bucket pipeline aggregation? It'd look something like:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/8/a8740302acadacc2e561c1456dc58143dadafde0.png)

---

<div class="post-metadata">

**Author:** ![Invictus](https://avatars.discourse-cdn.com/v4/letter/i/bc79bd/32.png) [@Invictus](https://discuss.elastic.co/u/Invictus)\
**Post date:** [May 14, 2018, 12:15pm UTC](https://discuss.elastic.co/t/nested-query-in-kibana/131125/4 "2018-05-14T12:15:14Z")

</div>

Yes, what worked. It was a big fail from my part.  
I made this aggregation via Sum Bucket before and I forgot to set the Size to 10, because of 10 Containers. So the value was to low 0.325% now I set the Size to 10 and i got the same value as in the data table.

Thanks for your reply, Thomas.

---

<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:** [June 11, 2018, 12:17pm UTC](https://discuss.elastic.co/t/nested-query-in-kibana/131125/5 "2018-06-11T12:17:48Z")

</div>

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