# Nested aggregations in kibana

**URL:** <https://discuss.elastic.co/t/nested-aggregations-in-kibana/16530>\
**Category:** Elasticsearch\
**Created:** [March 21, 2014, 8:07pm UTC](https://discuss.elastic.co/t/nested-aggregations-in-kibana/16530 "2014-03-21T20:07:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jon\_Stearley](https://avatars.discourse-cdn.com/v4/letter/j/65b543/32.png) [@Jon\_Stearley](https://discuss.elastic.co/u/Jon_Stearley)\
**Post date:** [March 21, 2014, 8:07pm UTC](https://discuss.elastic.co/t/nested-aggregations-in-kibana/16530/1 "2014-03-21T20:07:45Z")

</div>

Hello. I'm trying to make a 2D contingency table in Kibana (eg domain by  
\_type). The below in Chrome/Sense returns reasonable results, but how do I  
get this displayed in kibana? I'm trying to use a table panel but can't  
figure out where to put the query - maybe a different panel or future  
aggregations panel is needed? Thanks.

-Jon Stearley

HERE IS THE QUERY:

GET /\_all/\_search  
{  
"aggregations": {  
"domains": {  
"terms": {  
"field": "DOMAIN"  
},  
"aggregations": {  
"bytype": {  
"terms":{  
"field":"\_type"  
}  
}  
}  
}  
},  
"size": 0  
}

HERE IS AN EXAMPLE RESULT (actual domains and types anonymized):

{  
"took": 252,  
"timed\_out": false,  
"\_shards": {  
"total": 6,  
"successful": 6,  
"failed": 0  
},  
"hits": {  
"total": 967233,  
"max\_score": 0,  
"hits": []  
},  
"aggregations": {  
"domains": {  
"buckets": [  
{  
"key": "bleh.blech",  
"doc\_count": 3508,  
"bytype": {  
"buckets": [  
{  
"key": "type",  
"doc\_count": 3506  
},  
{  
"key": "typeb",  
"doc\_count": 2  
}  
]  
}  
},  
{  
"key": "foo.gah",  
"doc\_count": 3470,  
"bytype": {  
"buckets": [  
{  
"key": "typea",  
"doc\_count": 3400  
},  
{  
"key": "typeb",  
"doc\_count": 70  
}  
]  
}  
}  
]  
}  
}  
}

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/565187bd-5abe-433b-be07-44cd107bd607%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/565187bd-5abe-433b-be07-44cd107bd607%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly\_2](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@Binh\_Ly\_2](https://discuss.elastic.co/u/Binh_Ly_2)\
**Post date:** [March 24, 2014, 4:59pm UTC](https://discuss.elastic.co/t/nested-aggregations-in-kibana/16530/2 "2014-03-24T16:59:31Z")

</div>

Kibana is still using facets at the moment. Panels with ES aggregations  
capabilities will be coming in the future. For now, you'll have to build  
the panel yourself if you need it today.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/532e8bd3-1e2b-444c-92e5-d577a0b2c4da%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/532e8bd3-1e2b-444c-92e5-d577a0b2c4da%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:41am UTC](https://discuss.elastic.co/t/nested-aggregations-in-kibana/16530/3 "2017-07-06T01:41:03Z")

</div>


