Autodiscover name

Currently, using the autodiscover feature, in kibana heartbeat dashboard all services have name "Unnamed-auto-tcp...".
How to provide a name using some docker label?
Tried using the following configuration with no results:

heartbeat.autodiscover:
  providers:
    - type: docker
      templates:
        - condition:
            not:
              equals:
                docker.container.labels.app: web
          config:
            - type: tcp
              hosts: ["${data.host}:${data.port}"]
              schedule: "@every 1m"
              timeout: 1s
              name: "${docker.container.labels.app}"

The event has empty "monitor.name" field.
Also tried name: "%{[docker][container][labels][app]}", but "montior.name" becomes " %{[docker][container][labels][app]}".

Using a static name works (name: some_name), but all docker services will have the same name.

I have problems with incorrect names in heartbeat also.
Running this config in heartbeat.yml on my logstash server:

heartbeat.monitors:

  • type: tcp
    hosts: ["logstashservername"]
    ports: [5044]
    schedule: '@every 10s'

Use output Logstash:

output.logstash:
hosts: ["logstashserver1:5044","logstashserver1:5044"]

Get Name: "[Unnamed - auto-tcp-0XAAF24562C128E8BB]" under Uptime in Kibana when the node reports in.

The fun thing is that i copy the heartbeat.yml from my other cluster running 6.6.0 where the names show correctly. But its a changed GUI in 7.3.1, its not called host any more, now its called name.

Can i change the name?

The issue here is that ${docker.container.labels.app} needs to be prefixed with data. Try using ${data.docker.container.labels.app} as a value instead

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