Exiting: couldn't connect to any of the configured Elasticsearch hosts. Errors: [error connecting to Elasticsearch

Hello dears,

I'm getting errors when running filebeats on a remote server to test the Elasticsearch connection

Below is the error image and description.

sudo filebeat setup -E output.logstash.enabled=false -E output.elasticsearch.hosts=['10.35.33.65:9200'] -E setup.kibana.host=10.35.33.65:5601
Exiting: couldn't connect to any of the configured Elasticsearch hosts. Errors: [error connecting to Elasticsearch at http://10.35.33.65:9200: Get "http://10.35.33.65:9200": EOF]
[rcmag.kta@XXXXXXXXX~]$

segue a configuração do /etc/filebeat/filebeat.yml


---------------------------- Elasticsearch Output ----------------------------
output.elasticsearch:
<# Array of hosts to connect to./>
hosts: ["https://10.35.33.65:9200"]

<# Protocol - either http (default) or https./>
#protocol: "https"

<# Authentication credentials - either API key or username/password./>

#api_key: "id:api_key"
#username: "elastic"
#password: "changeme"

< # ------------------------------ Logstash Output ------------------------------- />
output.logstash:
< # The Logstash hosts />
hosts: ["10.35.33.65:5044"]

< # Optional SSL. By default is off. />
< # List of root certificates for HTTPS server verifications />
#ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

< # Certificate for SSL client authentication />
#ssl.certificate: "/etc/pki/client/cert.pem"

< # Client Certificate Key />
#ssl.key: "/etc/pki/client/cert.key"


Can you please help.

Please don't post pictures of text, logs or code. They are difficult to read, impossible to search and replicate (if it's code), and some people may not be even able to see them.

Please also format your code/logs/config using the </> button, or markdown style back ticks. It helps to make things easy to read which helps us help you :slight_smile:

follow the formatted file settings as requested

sudo vi /etc/filebeat/filebeat.yml

---------------------------- Elasticsearch Output ----------------------------
output.elasticsearch:
<# Array of hosts to connect to./>
hosts: ["https://10.35.33.65:9200"]

<# Protocol - either http (default) or https./>
#protocol: "https"

<# Authentication credentials - either API key or username/password./>

#api_key: "id:api_key"
#username: "elastic"
#password: "changeme"

< # ------------------------------ Logstash Output ------------------------------- />
output.logstash:
< # The Logstash hosts />
hosts: ["10.35.33.65:5044"]

< # Optional SSL. By default is off. />
< # List of root certificates for HTTPS server verifications />
#ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

< # Certificate for SSL client authentication />
#ssl.certificate: "/etc/pki/client/cert.pem"

< # Client Certificate Key />
#ssl.key: "/etc/pki/client/cert.key"

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