Retrieve elasticsearch.hosts from Kibana config in plugin

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

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