sherifabdlnaby / elastdocker

🐳 Elastic Stack (ELK) v8+ on Docker with Compose. Pre-configured out of the box to enable Logging, Metrics, APM, Alerting, ML, and SIEM features. Up with a Single Command.
https://towardsdatascience.com/running-securing-and-deploying-elastic-stack-on-docker-f1a8ebf1dc5b
MIT License
1.81k stars 320 forks source link

How to configure heartbeat with elasticsearch? #70

Closed btmndkh closed 2 years ago

btmndkh commented 2 years ago

Could you please guide me to how to configure heartbeat.yml for easly access with elasticsearch?

I'm tried following configuration...still no luck :(

output

output.elasticsearch: hosts: ["https://192.168.1.1:9200"] protocol: "https" username: elastic password: changeme

Use SSL settings for HTTPS.

ssl.enabled: true

ssl.certificate_authorities: ["/path/elastdocker/secrets/certs/ca/ca.crt"]

ssl.certificate: "/path/elastdocker/secrets/certs/elasticsearch/elasticsearch.crt"

ssl.key: "/path/elastdocker/secrets/certs/elasticsearch/elasticsearch.key"

tried - not working

https://www.elastic.co/guide/en/beats/heartbeat/8.0/elasticsearch-output.html

test

root@test:/etc/heartbeat# heartbeat test output elasticsearch: https://192.168.1.1:9200... parse url... OK connection... parse host... OK dns lookup... OK addresses: 192.168.1.1 dial up... OK TLS... security... WARN server's certificate chain verification is disabled handshake... ERROR x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "Elastic Certificate Tool Autogenerated CA")

btmndkh commented 2 years ago

I tried this handshake problem is solved but still can't connect with elasticsearch

output.elasticsearch: hosts: ["https://192.168.1.1:9200"] protocol: "https" username: 'elastic' password: 'changeme' ssl.enabled: true ssl.certificate_authorities: ["/path/elastdocker/secrets/certs/ca/ca.crt"] ssl.verification_mode: none

ssl.certificate: "/path/elastdocker/secrets/certs/elasticsearch/elasticsearch.crt"

ssl.key: "/path/elastdocker/secrets/certs/elasticsearch/elasticsearch.key"

btmndkh commented 2 years ago

just "ssl.verification_mode: none" works