# Autodiscover name

**URL:** https://discuss.elastic.co/t/autodiscover-name/198582
**Category:** Beats
**Tags:** heartbeat
**Created:** [September 8, 2019, 10:22pm UTC](https://discuss.elastic.co/t/autodiscover-name/198582 "2019-09-08T22:22:59Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![cdalexndr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cdalexndr/32/55274_2.png) [@cdalexndr](https://discuss.elastic.co/u/cdalexndr)
#### Post date: [September 8, 2019, 10:22pm UTC](https://discuss.elastic.co/t/autodiscover-name/198582/1 "2019-09-08T22:22:59Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Maekee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maekee/32/21708_2.png) [@Maekee](https://discuss.elastic.co/u/Maekee)
#### Post date: [September 16, 2019, 1:38pm UTC](https://discuss.elastic.co/t/autodiscover-name/198582/2 "2019-09-16T13:38:55Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)
#### Post date: [September 16, 2019, 2:42pm UTC](https://discuss.elastic.co/t/autodiscover-name/198582/3 "2019-09-16T14:42:15Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [October 14, 2019, 2:42pm UTC](https://discuss.elastic.co/t/autodiscover-name/198582/4 "2019-10-14T14:42:26Z")

</div>

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