How to get elastic search host in my plugin


(graylog) #1

im working on a plugin

how can i access elasticsearch_hosts in my plugin

getElasticHost() method in ElasticConfig class seams not working


(Jochen) #2

What are you trying to accomplish?


(graylog) #3

i want to use elastchosts which are defined in .conf file


(Jochen) #4

You can inject the JestClient, also see https://github.com/searchbox-io/Jest.

Example:


(graylog) #5

from this i will get jestClient but i need hosts “localhost:9200” im not trying to connect to elastic but i need host for some reason

thanks


(Jochen) #6

Take a look at JestClientProvider for an example how to inject Elasticsearch-related configuration settings.


(system) #7

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