# Unknown key 'elasticsearch.hosts' for Kibana plugin config

**URL:** <https://discuss.elastic.co/t/unknown-key-elasticsearch-hosts-for-kibana-plugin-config/211254>\
**Category:** Kibana\
**Created:** [December 10, 2019, 9:18am UTC](https://discuss.elastic.co/t/unknown-key-elasticsearch-hosts-for-kibana-plugin-config/211254 "2019-12-10T09:18:07Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![azasypkin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/azasypkin/32/42216_2.png) [@azasypkin](https://discuss.elastic.co/u/azasypkin)\
**Post date:** [December 11, 2019, 11:21am UTC](https://discuss.elastic.co/t/unknown-key-elasticsearch-hosts-for-kibana-plugin-config/211254/2 "2019-12-11T11:21:56Z")

</div>

Hi @Elaak,

Well, Kibana is in a process of migration to a so called new platform. And this config is no longer a part of the plugin contract (APIs that custom plugins have access to). Currently you can still access it through BWC hook, but there is no guarantee that it will be available in 8.0:

```javascript
const legacyEsConfig = await server.newPlatform.__internals.elasticsearch.legacy.config$
        .pipe(first())
        .toPromise();
const hosts = legacyEsConfig.hosts;

```

May I ask you why you need to access this value? Also maybe it's a good time for you to start writing "New Platform" plugins (assuming the new platform provides you with all necessary APIs already, see examples [here](https://github.com/elastic/kibana/tree/master/src/plugins) and [here](https://github.com/elastic/kibana/tree/master/x-pack/plugins)).

Best,  
Oleg

---

_[View the full topic](https://discuss.elastic.co/t/unknown-key-elasticsearch-hosts-for-kibana-plugin-config/211254)._
