# Manually add geo point to server logs

**URL:** https://discuss.elastic.co/t/manually-add-geo-point-to-server-logs/285793
**Category:** Logstash
**Created:** [October 4, 2021, 8:50am UTC](https://discuss.elastic.co/t/manually-add-geo-point-to-server-logs/285793 "2021-10-04T08:50:24Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![maltewhiite](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maltewhiite/32/94551_2.png) [@maltewhiite](https://discuss.elastic.co/u/maltewhiite)
#### Post date: [October 4, 2021, 8:50am UTC](https://discuss.elastic.co/t/manually-add-geo-point-to-server-logs/285793/1 "2021-10-04T08:50:24Z")

</div>

How do I add the location of our servers as a geo-point that can be used with Kibana Maps to the logs of that server?

For example:  
Let's say a log has agent.name "AgentExample01", then I would match on that, and add lat and lon, so I could see that "AgentExample01" and visualize its logs on a Kibana Map.

I want to be able to visualize our data on a map. Because it is coming from 100+ places in our country. But I don't know how to manually add the location of the servers to the incoming logs.

For example I'd like to be able to see Uptime on a Map. If a server doesn't respond via Heartbeat, then I'd like to see a Red dot on the map.  
Or if it has high CPU usage and/or Load, then I'd like to put a yellow dot on the map where that server is.

---

<div class="post-metadata">

### Author: ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)
#### Post date: [October 4, 2021, 1:45pm UTC](https://discuss.elastic.co/t/manually-add-geo-point-to-server-logs/285793/2 "2021-10-04T13:45:59Z")

</div>

The correct way to do this would be to add in your servers' beats configuration their location, so they add to each event their proper metadata in the Elastic Common Schema.

> **[Add Observer metadata | Heartbeat Reference \[7.15\] | Elastic](https://www.elastic.co/guide/en/beats/heartbeat/current/add-observer-metadata.html)**

It's documented in the [heartbeat installation guide](https://www.elastic.co/guide/en/beats/heartbeat/current/heartbeat-installation-configuration.html#configurelocation) and on [this guide](https://www.elastic.co/guide/en/beats/heartbeat/current/configuration-observer-options.html).

With the geo metadata the Uptime app, part of the Observability solution, will show you a map as described in [this blog post](https://www.elastic.co/blog/service-monitoring-and-availability-made-simple-with-elastic-uptime-and-heartbeat).

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/2/526a2ea718c3b330cc221f790e06296d21422bb8.jpeg)

* * *

Another way would be to use the [Elastic Maps](https://www.elastic.co/guide/en/kibana/current/maps.html) instead, create a new index with the server locations (for example [uploading a GeoJSON file](https://www.elastic.co/guide/en/kibana/current/import-geospatial-data.html) in Kibana Maps), and then create a map that does the [Term Join](https://www.elastic.co/guide/en/kibana/current/terms-join.html) in the browser to count (fo example) the number of measurements in the last `X` minutes.

Hope it helps.

---

<div class="post-metadata">

### Author: ![maltewhiite](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maltewhiite/32/94551_2.png) [@maltewhiite](https://discuss.elastic.co/u/maltewhiite)
#### Post date: [October 4, 2021, 1:47pm UTC](https://discuss.elastic.co/t/manually-add-geo-point-to-server-logs/285793/3 "2021-10-04T13:47:11Z")

</div>

Thanks a lot! Will try this tomorrow. Attaching it to our internal issue.

---

<div class="post-metadata">

### Author: ![maltewhiite](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maltewhiite/32/94551_2.png) [@maltewhiite](https://discuss.elastic.co/u/maltewhiite)
#### Post date: [October 4, 2021, 2:38pm UTC](https://discuss.elastic.co/t/manually-add-geo-point-to-server-logs/285793/4 "2021-10-04T14:38:28Z")

</div>

Made a quick attempt with the Term Join method, but it doesn't seem to work for us: ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/5/2501a87400a7c7eeb051d7feae3c0d768e0c5b7f.png)

Trying the other method tomorrow

---

<div class="post-metadata">

### Author: ![maltewhiite](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maltewhiite/32/94551_2.png) [@maltewhiite](https://discuss.elastic.co/u/maltewhiite)
#### Post date: [October 5, 2021, 11:36am UTC](https://discuss.elastic.co/t/manually-add-geo-point-to-server-logs/285793/5 "2021-10-05T11:36:35Z")

</div>

Is there an easy way to do this when you manage the Beats with Puppet?

---

<div class="post-metadata">

### Author: ![zx8086](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zx8086/32/94917_2.png) [@zx8086](https://discuss.elastic.co/u/zx8086)
#### Post date: [October 5, 2021, 11:46am UTC](https://discuss.elastic.co/t/manually-add-geo-point-to-server-logs/285793/6 "2021-10-05T11:46:55Z")

</div>

@maltewhiite I manage this through Ansible, using the Add Observer Data as mentioned.

So with each deployment of a beats shippers, the variables are substituted with the actual geo locations from a reference file.

![Screen Shot 2021-10-05 at 1.44.59 PM](https://us1.discourse-cdn.com/elastic/original/3X/0/6/0612131b79f97c43ed90de1807d5484b29c95e9e.png)

 ![Screen Shot 2021-10-05 at 1.46.03 PM](https://us1.discourse-cdn.com/elastic/original/3X/2/6/26099d416ecbc8603503cb8633c52e902c065a0b.png)

---

<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: [November 2, 2021, 11:47am UTC](https://discuss.elastic.co/t/manually-add-geo-point-to-server-logs/285793/7 "2021-11-02T11:47:47Z")

</div>

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