Unable to load Heartbeat dashboards for kibana

Dashboard loading currently does not work via logstash.

Which elasticsearch version are you using? Due to a bug in 6.0 it's best to configure elasticsearch and kibana for the time of loading the dashboads. By running the heartbeat setup command, no events will be published and heartbeat quits after installing the dashboards and template mappings. See help message:

 ./heartbeat help setup
This command does initial setup of the environment:

 * Index mapping template in Elasticsearch to ensure fields are mapped.
 * Kibana dashboards (where available).
 * ML jobs (where available).

Usage:
  heartbeat setup [flags]

Flags:
      --dashboards         Setup dashboards only
  -h, --help               help for setup
      --machine-learning   Setup machine learning job configurations only
      --template           Setup index template only

Global Flags:
  -E, --E setting=value      Configuration overwrite
  -c, --c string             Configuration file, relative to path.config (default "heartbeat.yml")
  -d, --d string             Enable certain debug selectors
  -e, --e                    Log to stderr and disable syslog/file output
      --path.config string   Configuration path
      --path.data string     Data path
      --path.home string     Home path
      --path.logs string     Logs path
      --strict.perms         Strict permission checking on config files (default true)
  -v, --v                    Log at INFO level

You can run it like this:

heartbeat setup -E output.logstash.enabled=false -E 'output.elasticsearch={hosts: "http://es_home:9200", ... }' -e -v -c heartbeat.yml

Considering you might run this command at other times, or you might have passwords for ES/kibana you need to pass, create a second setup.yml file stating:

output.logstash.enabled=false # disable logstash

output.elasticsearch:
  ...

setup:
  kibana: # kibana settings

  ...

Then you can run:

heartbeat setup -e -v -c heartbeat.yml -c setup.yml

I understand it's not very user friendly for logstash users. But we hope to find a better solution for loading dashboards via Logstash in the future.