# Use elasticsearch to query kibana dashboards?

**URL:** <https://discuss.elastic.co/t/use-elasticsearch-to-query-kibana-dashboards/82000>\
**Category:** Elasticsearch\
**Created:** [April 11, 2017, 2:35pm UTC](https://discuss.elastic.co/t/use-elasticsearch-to-query-kibana-dashboards/82000 "2017-04-11T14:35:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Hoffman](https://avatars.discourse-cdn.com/v4/letter/b/71e660/32.png) [@Ben\_Hoffman](https://discuss.elastic.co/u/Ben_Hoffman)\
**Post date:** [April 11, 2017, 2:35pm UTC](https://discuss.elastic.co/t/use-elasticsearch-to-query-kibana-dashboards/82000/1 "2017-04-11T14:35:37Z")

</div>

Hey there

Is it possible to get the statistics that are shown by my Kibana dashboard? Simple things like the top 3 things with the biggest counts.

For example, with Packetbeat, I want to see the most common IP addresses that are shown in my Kibana dashboard.

Is that possible with a query in elasticsearch?

---

<div class="post-metadata">

**Author:** ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)\
**Post date:** [April 12, 2017, 1:05am UTC](https://discuss.elastic.co/t/use-elasticsearch-to-query-kibana-dashboards/82000/2 "2017-04-12T01:05:35Z")

</div>

Yes, you can just grab the query from the visualization and see how kibana is doing it.  
2.4  
Just go to Settings -\> Objects -\> visualizations and view the visualization that you want to replicate

and you can see how it is made

 ![](https://us1.discourse-cdn.com/elastic/original/3X/7/3/734bb753b00c83d6862576a143f33c2cea142fda.png)

5.3 similar steps

but to read up on the docs, you want to make "Aggregations"  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html)

But I like seeing how Kibana does it then modifying the query from there.Saves me time thinking

---

<div class="post-metadata">

**Author:** ![Ben\_Hoffman](https://avatars.discourse-cdn.com/v4/letter/b/71e660/32.png) [@Ben\_Hoffman](https://discuss.elastic.co/u/Ben_Hoffman)\
**Post date:** [April 24, 2017, 2:31pm UTC](https://discuss.elastic.co/t/use-elasticsearch-to-query-kibana-dashboards/82000/3 "2017-04-24T14:31:24Z")

</div>

Ok that makes sense, but how would I translate that into a curl request or similar?

---

<div class="post-metadata">

**Author:** ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)\
**Post date:** [April 29, 2017, 10:00pm UTC](https://discuss.elastic.co/t/use-elasticsearch-to-query-kibana-dashboards/82000/4 "2017-04-29T22:00:16Z")

</div>

Just issue what Kibana issues via curl

curl -XPOST /index/\_search -d ' { }'

---

<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:** [May 27, 2017, 10:12pm UTC](https://discuss.elastic.co/t/use-elasticsearch-to-query-kibana-dashboards/82000/5 "2017-05-27T22:12:03Z")

</div>

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