# Querying Elasticsearch from Kibana

**URL:** https://discuss.elastic.co/t/querying-elasticsearch-from-kibana/49393
**Category:** Kibana
**Created:** [May 6, 2016, 10:09am UTC](https://discuss.elastic.co/t/querying-elasticsearch-from-kibana/49393 "2016-05-06T10:09:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Veer\_Shubhranshu\_Shr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/veer_shubhranshu_shr/32/9530_2.png) [@Veer\_Shubhranshu\_Shr](https://discuss.elastic.co/u/Veer_Shubhranshu_Shr)
#### Post date: [May 6, 2016, 10:09am UTC](https://discuss.elastic.co/t/querying-elasticsearch-from-kibana/49393/1 "2016-05-06T10:09:10Z")

</div>

Hi,

I am trying to build a new custom plugin for Kibana and query elasticsearch from Kibana plugin.

I understand that it can be possible using simple AJAX. But is there any other approach to do the same from Kibana built in API?

I was not able to find any useful docs regarding the same. If someone could share the useful link to docs then that would help a lot.

Thanks.

---

<div class="post-metadata">

### Author: ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)
#### Post date: [May 6, 2016, 12:01pm UTC](https://discuss.elastic.co/t/querying-elasticsearch-from-kibana/49393/2 "2016-05-06T12:01:50Z")

</div>

Hi, this page lists useful resources on getting started with Kibana plugin development: [https://github.com/elastic/kibana/wiki/Plugin-Resources](https://github.com/elastic/kibana/wiki/Plugin-Resources).

How you connect to Elasticsearch from within your plugin will depend on the type of plugin you are building:

- If you are building a visualization plugin that plans to use Elasticsearch's aggregations and visualize the results, Kibana will handle the connection for you and abstract away the details.
- If you want a more direct connection to Elasticsearch, that is also possible via the `callWithRequest` method provided by the Elasticsearch plugin in Kibana.

I recommend reading through the list of resources on the wiki page I linked to above, particularly Tim Roes' blog post, _Writing Kibana 4 Plugins_ — he covers both types of connections to Elasticsearch that I've mentioned here. But please also see the other resources on the wiki page to get a more complete understanding and don't hesitate to chat with Kibana core developers in the #kibana IRC channel on Freenode.

---

<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:54pm UTC](https://discuss.elastic.co/t/querying-elasticsearch-from-kibana/49393/3 "2017-07-06T13:54:03Z")

</div>


