Access variables in Kibana.yml

Hi all,

I trying to make changes to kibana core source code and I trying to access the variables in kibana.yml file from my JS file. Example is shown as below:

let elastic_url = process.env['elasticsearch.hosts']

Would really appreciate if anyone can give some pointers.

Note: I not trying to access from plugins.

Hey @GiGiLord

Generally speaking, within the new plugin structure, variables from kibana.yml are accessible only on the server side by using the plugin context initializerContext.config that's passed to the server plugin constructor as the first parameter.

For example, if you look at src/plugins/data/server/plugin.ts, it receives an initializerConfig parameter. In your own server side plugin you could do initializerContext.config.get('...').

I hope this points you out in the right direction!

1 Like

Hi Liza, Thanks for the prompt reply.

ok, I will try to work on the solution that u give. I assuming the Discover module is also setup and structure like a plugin. Am I correct?

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