Get elasticsearch hostnames from kibana plugin

I removed a hard coded entry for a test environment, and realized that my code to detect the ES endpoints doesn't work anymore.

I was doing this

const config = server.config() // server is passed down from plugin initializer and routers
const esConfig = config.get('elasticsearch')
const hosts = esConfig.hosts // I seem to remember this being ['elasticsearch-1', 'elasticsearch-2']

I don't recall if this was working, but how should I approach getting this information from kibana? I plan to run kibana and ES together with ECK.

What version of kibana are you using? Is your plugin using using legacy platform or new Kibana platform?

7.7. legacy generator. I plan on rebuilding with the current one soon, though

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