# Retrieve elasticsearch.hosts from Kibana config in plugin

**URL:** <https://discuss.elastic.co/t/retrieve-elasticsearch-hosts-from-kibana-config-in-plugin/202152>\
**Category:** Kibana\
**Created:** [October 3, 2019, 11:00am UTC](https://discuss.elastic.co/t/retrieve-elasticsearch-hosts-from-kibana-config-in-plugin/202152 "2019-10-03T11:00:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![arseni-lipinski](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@arseni-lipinski](https://discuss.elastic.co/u/arseni-lipinski)\
**Post date:** [October 3, 2019, 11:00am UTC](https://discuss.elastic.co/t/retrieve-elasticsearch-hosts-from-kibana-config-in-plugin/202152/1 "2019-10-03T11:00:02Z")

</div>

Hello

I'm experiencing the same issue, as [here](https://discuss.elastic.co/t/xpack-elastic-host-error/194885)

Since it was not resolved there, I'll try once again.  
What is the proper way to retrieve elasticsearch.hosts in plugin for Kibana?

@Oleg , @spalger

---

<div class="post-metadata">

**Author:** ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)\
**Post date:** [October 3, 2019, 5:27pm UTC](https://discuss.elastic.co/t/retrieve-elasticsearch-hosts-from-kibana-config-in-plugin/202152/2 "2019-10-03T17:27:06Z")

</div>

You can get any value from the kibana config by accessing `server.config().get('{config.key}')`, so to get elasticsearch.hosts you can use

```auto
server.config().get('elasticsearch.hosts')

```

---

<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:** [October 31, 2019, 5:27pm UTC](https://discuss.elastic.co/t/retrieve-elasticsearch-hosts-from-kibana-config-in-plugin/202152/3 "2019-10-31T17:27:11Z")

</div>

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