I am using Elastic stack 7.4.2 and I am having this simple issue with just getting the configured elasticsearch hosts. It should not be more difficult than
server.config().get('elasticsearch.hosts')
but I get the error "Unknown config key: elasticsearch.hosts". When I do a console.log of my config, I see that elasticsearch only has one key: enabled: true. Why is it that the configuration is not accessible?
In my kibana.yml I have elasticsearch.hosts: ['http://localhost:9299'] configured and kibana receives data, so the configuration itself must be correct.
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:
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 and here).
This morning I found out about the elasticsearch client that I can implement in Kibana instead. The plan was otherwise to make a call to the elasticsearch API for my task, but I tested your solution in case I in the future need to access other values from this config.
Currently we have decided to stay at version 7.4 for our setup so the plugin has to be developed for that version.
This morning I found out about the elasticsearch client that I can implement in Kibana instead. The plan was otherwise to make a call to the elasticsearch API for my task, but I tested your solution in case I in the future need to access other values from this config.
Currently we have decided to stay at version 7.4 for our setup so the plugin has to be developed for that version.
Currently we have decided to stay at version 7.4 for our setup so the plugin has to be developed for that version.
Sure, just wanted to note that new platform plugins are already supported in 7.4 as well, it's just an amount of APIs that are available is limited and constantly increasing. The plan is to support new platform plugins only since 8.0 - so make sure to allocate some time to migrate before next major version upgrade.
Hi @Elaak@azasypkin
I did not get the solution here.
I am using Kibana 7.4.2, and I have properly configured kibana.yml and I get the same error while starting the service.
I am using the kibana_own_home plugin.
Could you please explain what exactly I am supposed to do to get over the error ?
I am stuck !!
Do you also use server.config().get('elasticsearch.hosts') in your plugin? If not, then please create a new thread to avoid mixing two unrelated issues.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.