# Need assistance to create map based on longitude ,lat fields?

**URL:** <https://discuss.elastic.co/t/need-assistance-to-create-map-based-on-longitude-lat-fields/41439>\
**Category:** Kibana\
**Created:** [February 10, 2016, 10:29pm UTC](https://discuss.elastic.co/t/need-assistance-to-create-map-based-on-longitude-lat-fields/41439 "2016-02-10T22:29:37Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [February 10, 2016, 10:29pm UTC](https://discuss.elastic.co/t/need-assistance-to-create-map-based-on-longitude-lat-fields/41439/1 "2016-02-10T22:29:37Z")

</div>

Hi Experts,

I have 2 fields in my logs with the name , dlong,dlat and values are like 37.3394012451,-121.8950042724.

I want to show them on map in kibana . Please suggest how I can achieve this?

Thanks  
VG

---

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [February 11, 2016, 5:02pm UTC](https://discuss.elastic.co/t/need-assistance-to-create-map-based-on-longitude-lat-fields/41439/2 "2016-02-11T17:02:30Z")

</div>

To use tile maps in Kibana 4, you need to index the geo field as a geo\_point type: [https://www.elastic.co/guide/en/elasticsearch/reference/1.4/mapping-geo-point-type.html](https://www.elastic.co/guide/en/elasticsearch/reference/1.4/mapping-geo-point-type.html)

---

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [February 13, 2016, 3:53pm UTC](https://discuss.elastic.co/t/need-assistance-to-create-map-based-on-longitude-lat-fields/41439/3 "2016-02-13T15:53:40Z")

</div>

Thank you Tanya,

Here I have a confusion , as you suggested I have to convert both the geo fields i.e slong,slat which are string as of now to geo\_point type rt? so something like  
"slong" : {"type": "geoip"},  
"slat" : {"type": "geoip"},

Secondly if I convert both the fields into geoip do I need to use geoip {} filter in logstash ? as i want to show src filed IPs on map.

Thanks  
VG

---

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [February 13, 2016, 5:17pm UTC](https://discuss.elastic.co/t/need-assistance-to-create-map-based-on-longitude-lat-fields/41439/4 "2016-02-13T17:17:22Z")

</div>

Yeah, you should use Logstash. Here is a good thread on this topic: [Displaying Geo data on Tile Map](https://discuss.elastic.co/t/displaying-geo-data-on-tile-map/29528)

---

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [February 17, 2016, 10:25am UTC](https://discuss.elastic.co/t/need-assistance-to-create-map-based-on-longitude-lat-fields/41439/5 "2016-02-17T10:25:01Z")

</div>

Thanks Tanya,

It helps alot, and it works for me ..🙂

---

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [February 18, 2016, 8:28am UTC](https://discuss.elastic.co/t/need-assistance-to-create-map-based-on-longitude-lat-fields/41439/6 "2016-02-18T08:28:27Z")

</div>

@Tanya,

Thank you for the assistance, I tried following and it works

```
  mutate {
        convert => {
            "slat" => "float"
            "slong" => "float"
        }
        add_field => {
            "[geoip][location]" => ["%{slong}", "%{slat}"]
            "[geoip][latitude]" => "%{slat}"
            "[geoip][longitude]" => "%{slong}"
        }

} 

```

My next concern is how i can get Country name out of it ?

Thanks  
Vikas

---

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [February 18, 2016, 1:48pm UTC](https://discuss.elastic.co/t/need-assistance-to-create-map-based-on-longitude-lat-fields/41439/7 "2016-02-18T13:48:09Z")

</div>

If you have an IP address, you can get country from GeoIP mapping using a Logstash filter: [https://www.elastic.co/guide/en/logstash/current/plugins-filters-geoip.html](https://www.elastic.co/guide/en/logstash/current/plugins-filters-geoip.html)

Otherwise, to get country information from the geographical coordinates, you'd need to hit something like the Google geocoding API: [https://developers.google.com/maps/documentation/geocoding/intro?csw=1](https://developers.google.com/maps/documentation/geocoding/intro?csw=1) Logstash has an HTTP input which may but you may need to do that mapping outside of Logstash, as I don't believe there currently is an HTTP filter. You may want to ask this question in another thread on the Logstash channel.

---

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [February 18, 2016, 2:01pm UTC](https://discuss.elastic.co/t/need-assistance-to-create-map-based-on-longitude-lat-fields/41439/8 "2016-02-18T14:01:06Z")

</div>

Thank you Again Tanya , I'll open separate thread on LS.

---

<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:** [July 6, 2017, 2:01pm UTC](https://discuss.elastic.co/t/need-assistance-to-create-map-based-on-longitude-lat-fields/41439/9 "2017-07-06T14:01:56Z")

</div>


