Unable to configure filebeat: Could not connect to elasticsearch host

I keep getting this when trying to configure filebeats to elastic


The key value has been corrected.

filebeat.yml:

# ---------------------------- Elasticsearch Output ----------------------------
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["192.168.56.106:9200"]

  # Protocol - either `http` (default) or `https`.
  #protocol: "http"

  # Authentication credentials - either API key or username/password.
  #api_key: "id:api_key"
  username: "elastic"
  password: "${ELASTIC_PASSWORD}"


Hi @Palak_Chopra

Please don't post images of text the are hard to read , cannot be cut and paste or debugged searched etc...

That said look at the 3rd line from the bottom.. you are not using the add keystore command correctly

Perhaps take a closer look at the docs don't use $

You can test the output with

filebeat test output

Sorry about the image.
I changed the keystore to, for now, a hardcoded password. Are these the elastic credentials or local for filebeat?

This is my output for filebeat test output.

elasticsearch: http://192.168.56.106:9200...
  parse url... OK
  connection...
    parse host... OK
    dns lookup... OK
    addresses: 192.168.56.106
    dial up... OK
  TLS... WARN secure connection disabled
  talk to server... ERROR Get "http://192.168.56.106:9200": EOF

That section is for the output to elasticsearch.

You can use the keystore you just need to run the command with the correct syntax