# Help with heartbeat setup of locations

**URL:** https://discuss.elastic.co/t/help-with-heartbeat-setup-of-locations/227555
**Category:** Beats
**Tags:** heartbeat
**Created:** [April 10, 2020, 7:33pm UTC](https://discuss.elastic.co/t/help-with-heartbeat-setup-of-locations/227555 "2020-04-10T19:33:24Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Sketchy](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@Sketchy](https://discuss.elastic.co/u/Sketchy)
#### Post date: [April 10, 2020, 7:33pm UTC](https://discuss.elastic.co/t/help-with-heartbeat-setup-of-locations/227555/1 "2020-04-10T19:33:24Z")

</div>

I have about 30 sites I would like to ping with heartbeat.  
I'm confused about how best to add the geo location and other info for each site.

Do I add each site to its own yaml file or is there a simple way to do it all in one file?

Sorry I'm new to beats and moving from another tool so I'm a little confused here, could someone show me an example of pinging multiple sites each with different location data?

---

<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: [April 14, 2020, 2:06am UTC](https://discuss.elastic.co/t/help-with-heartbeat-setup-of-locations/227555/2 "2020-04-14T02:06:24Z")

</div>

To clarify, would you like to add metadata for the Heartbeat instance doing the monitoring, or the site being monitored? I agree we could improve our docs here.

The [current docs](https://www.elastic.co/guide/en/beats/heartbeat/master/configuration-observer-options.html) only discuss how to add geo data for the heartbeat instance doing the monitoring.

---

<div class="post-metadata">

### Author: ![Sketchy](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@Sketchy](https://discuss.elastic.co/u/Sketchy)
#### Post date: [April 16, 2020, 5:13am UTC](https://discuss.elastic.co/t/help-with-heartbeat-setup-of-locations/227555/3 "2020-04-16T05:13:57Z")

</div>

Hi I'm adding both host data and observer data actually, but just working out the most efficient way to be adding the host data for each site. eg each site may have about 5 things being monitored then I want to add the host geo data for each of those sites.

I was trying to get it to work with a separate yml file for each site in monitors.d, then I wanted to have an input with the devices to be monitored and a processor for the geo data for that particular site in each "site file"

That doesn't seem to work as I don't think processors apply like that.

---

<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: [April 28, 2020, 9:31pm UTC](https://discuss.elastic.co/t/help-with-heartbeat-setup-of-locations/227555/4 "2020-04-28T21:31:58Z")

</div>

Sorry for the delay here. You can apply both host and observer geolocation data (though only the host observer data is shown in the Uptime UI).

I've opened a github issue to investigate making this easier, it'd be great to hear your thoughts [on the issue](https://github.com/elastic/uptime/issues/178).

---

<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: [April 28, 2020, 9:34pm UTC](https://discuss.elastic.co/t/help-with-heartbeat-setup-of-locations/227555/5 "2020-04-28T21:34:08Z")

</div>

Sorry, I forgot to mention how you can apply this per monitor. You can use the [fields](https://www.elastic.co/guide/en/beats/heartbeat/current/configuration-heartbeat-options.html#monitor-fields) option at the per-monitor level (and you'll probably want to set `fields_under_root` to true as well) to add arbitrary fields, including geo location ones.

Which ECS field would be appropriate is probably debatable here, but the [host.geo.\*](https://www.elastic.co/guide/en/ecs/current/ecs-host.html) fields are probably most appropriate.

---

<div class="post-metadata">

### Author: ![Luis\_Pereira1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luis_pereira1/32/43046_2.png) [@Luis\_Pereira1](https://discuss.elastic.co/u/Luis_Pereira1)
#### Post date: [May 1, 2020, 2:35pm UTC](https://discuss.elastic.co/t/help-with-heartbeat-setup-of-locations/227555/6 "2020-05-01T14:35:46Z")

</div>

Hi Andrew,

I'm also interested in adding geolocation to the hosts being monitored.  
From reading the messages above I don't. understand how do you map the host observer data to the monitored host.

Can you show me an example with these 2 hosts?

```
    - type: icmp
      schedule: '*/5 * * * * * *'
      hosts: ['192.168.100.20']
      name: 'DC1'

    - type: icmp
      schedule: '@every 10s'
      hosts: ['192.168.70.80']
      name: 'SRVLEIEXC1'
```

---

<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: [May 6, 2020, 9:50pm UTC](https://discuss.elastic.co/t/help-with-heartbeat-setup-of-locations/227555/7 "2020-05-06T21:50:25Z")

</div>

Sure, here's an example using the [ECS Host](https://www.elastic.co/guide/en/ecs/current/ecs-host.html) fields.

```auto
    - type: icmp
      schedule: '@every 10s'
      hosts: ['192.168.70.80']
      name: 'SRVLEIEXC1'
      fields_under_root: true
      fields:
        host:
          geo:
            name: "MyGeoLocName"
            location: "37.773972, -122.431297"

```

---

<div class="post-metadata">

### Author: ![Luis\_Pereira1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luis_pereira1/32/43046_2.png) [@Luis\_Pereira1](https://discuss.elastic.co/u/Luis_Pereira1)
#### Post date: [May 6, 2020, 10:48pm UTC](https://discuss.elastic.co/t/help-with-heartbeat-setup-of-locations/227555/8 "2020-05-06T22:48:35Z")

</div>

Thanks Andrew for the example,

It's working, now I just need to do the same thing for the others.  
If I can give you my opnion, I would prefer to view the host location in the uptime UI Map so I would have my information in the same place instead of the host (elastic) doing the monitoring, for me is not that important.

But I guess you can always build a dashboard for that...

Thanks again,  
Luis Pereira

---

<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: [May 6, 2020, 11:01pm UTC](https://discuss.elastic.co/t/help-with-heartbeat-setup-of-locations/227555/9 "2020-05-06T23:01:02Z")

</div>

Glad it works! I've opened an issue to track this feature request here: [https://github.com/elastic/uptime/issues/191](https://github.com/elastic/uptime/issues/191)

---

<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: [June 3, 2020, 11:01pm UTC](https://discuss.elastic.co/t/help-with-heartbeat-setup-of-locations/227555/10 "2020-06-03T23:01:19Z")

</div>

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