Logstash taking wrong url for Elasticserach

Hi, I have deployed elasticserach and logstash in kubernetes cluster. And my logstash is unable to connect to elasticserach.

Problem is:- my elasticserach url is:- https://my-server.com/elasticsearch

And logstash is taking:- https://my-server.com:9200/elasticsearch as a result of which it is getting connection timeout, not sure why it is taking (https://my-server.com:9200/elasticsearch), I have mentioned the host as (https://my-server.com/elasticsearch) in my logstash.conf file.

Note:- My elasticsearch is accessible only through (https://my-server.com/elasticsearch), where as logstash is taking (https://my-server.com:9200/elasticsearch)

Can someone help with this issue.

Because in the elasticsearch output code the default port is 9200. If you want it to use something else (e.g. 80) then you need to explicitly set that in the URL.

Hi, I want the url just to be https://my-server.com/elasticsearch. But in the logstash output it is taking https://my-server.com:9200/elasticsearch.

I have explicitly mentioned as https://my-server.com/elasticsearch only.

As badger said, you need to specify the port in your logstash configuration, if you do not specify the port logstash will use the port 9200.

In your case you should try to set hosts => "https://my-server.com:443/elasticsearch in your elasticsearch output.

Okay, I will try with port 443.

Thanks Leandrojmp, it is working now.

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