Monitoring a secure elasticsearch cluster with heartbeat

Hello,
I have a monitor on all my cluster nodes that monitors on port 9200.
But after enabling security, the heartbeat cannot of course access ES.

What is the syntax for the monitor to login securely
This is my current config

Configure monitors inline

heartbeat.monitors:

I use the output plugin for logstash.

I preferr not to specify credentials in the config file, using keystores for logstash and kibana for example. And my monitor account is very limited with permissions.

Can i configure this monitor to work for me when i require credentials.
(have not activated https yet)

You can use the heartbeat keystore for this. Once that's setup you can interpolate the password variables where you wish, just using a url like https://user:pass@mycluster:9200.

Thanks Andrew, this is how i solved the monitor, together with the keystore
heartbeat.monitors:

  • type: http
    name: "esnode01"
    id: "esnode01"
    urls: ["https://esnode01.domain.com:9200"]
    username: "username"
    password: "password"
    ssl.certificate_authorities: "C:\Program Files\Heartbeat\elastic-stack-ca.crt"
    schedule: '@every 10s'

If i create the keystore entries called ES_USER and ES_PWD and reference them in the heartbeat.yml like this:

username: "${ES_USER}"

password: "${ES_PWD}"

I get this error complaining on the first row:
2019-10-08T14:00:51.925+0200 ERROR instance/beat.go:877 Exiting: could not create monitor: job err missing field accessing 'heartbeat.monitors.0.username' (source:'C:\Program Files\Heartbeat\heartbeat.yml')

if i remove the first variable with a static username and let the password be left i get an error on the next row:
2019-10-08T14:04:52.351+0200 ERROR instance/beat.go:877 Exiting: could not create monitor: job err missing field accessing 'heartbeat.monitors.0.password' (source:'C:\Program Files\Heartbeat\heartbeat.yml')

So the variables for heartbeat dont seem to get read.

If i start heartbeat like this below.. it seems to work, but then i dont get any logging from heartbeat!!!

heartbeat.exe -e -c heartbeat.yml

this is the default starting command line for heartbeat in windows:
"C:\Program Files\Heartbeat\heartbeat.exe" -c "C:\Program Files\Heartbeat\heartbeat.yml" -path.home "C:\Program Files\Heartbeat" -path.data "C:\ProgramData\heartbeat" -path.logs "C:\ProgramData\heartbeat\logs" -E logging.files.redirect_stderr=true

heartbeat -?
-e, --e Log to stderr and disable syslog/file output

So can i have logging AND use variables?

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