# How Kibana connects to ElasticSearch and Fetch data to Kibana?

**URL:** <https://discuss.elastic.co/t/how-kibana-connects-to-elasticsearch-and-fetch-data-to-kibana/183898>\
**Category:** Kibana\
**Created:** [June 3, 2019, 7:01am UTC](https://discuss.elastic.co/t/how-kibana-connects-to-elasticsearch-and-fetch-data-to-kibana/183898 "2019-06-03T07:01:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![saravananselvamohan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saravananselvamohan/32/47407_2.png) [@saravananselvamohan](https://discuss.elastic.co/u/saravananselvamohan)\
**Post date:** [June 3, 2019, 7:01am UTC](https://discuss.elastic.co/t/how-kibana-connects-to-elasticsearch-and-fetch-data-to-kibana/183898/1 "2019-06-03T07:01:12Z")

</div>

I need to understand how Kibana connects to ElasticSearch and Fetch data to Kibana by code wise. I did a simple POC which connects with Elasticsearch uses search API and fetches the data by using simple match query in my node.js file. As a bigger picture i need to know how Kibana doing it from the Search Bar when we enter data to search. What is best way to proceed forward to this challenge?

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [June 3, 2019, 8:11pm UTC](https://discuss.elastic.co/t/how-kibana-connects-to-elasticsearch-and-fetch-data-to-kibana/183898/2 "2019-06-03T20:11:45Z")

</div>

Kibana uses the [@elastic/elasticsearch Node.js module](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html) to connect to Elasticsearch. This module is not specific to Kibana and can be used by other Node.js applications.

---

<div class="post-metadata">

**Author:** ![saravananselvamohan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saravananselvamohan/32/47407_2.png) [@saravananselvamohan](https://discuss.elastic.co/u/saravananselvamohan)\
**Post date:** [June 6, 2019, 6:58am UTC](https://discuss.elastic.co/t/how-kibana-connects-to-elasticsearch-and-fetch-data-to-kibana/183898/3 "2019-06-06T06:58:29Z")

</div>

Thanks for your reply. I understood from you Kibana connecting to Elasticsearch using Node.js module. But I need to understand from the code part how Search in QueryBar is converted to ElasticDSLQuery and how that Query interacts with ElasticSearch APIs.

---

<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 4, 2019, 6:58am UTC](https://discuss.elastic.co/t/how-kibana-connects-to-elasticsearch-and-fetch-data-to-kibana/183898/4 "2019-07-04T06:58:30Z")

</div>

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