Querying Elasticsearch from Kibana

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.

Hi, this page lists useful resources on getting started with Kibana plugin development: 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.