# Don't know how to make elasticsearch recognise the location coordenates properly for Map "visualitzation" on Kibana

**URL:** https://discuss.elastic.co/t/dont-know-how-to-make-elasticsearch-recognise-the-location-coordenates-properly-for-map-visualitzation-on-kibana/207113
**Category:** Logstash
**Created:** [November 8, 2019, 12:33pm UTC](https://discuss.elastic.co/t/dont-know-how-to-make-elasticsearch-recognise-the-location-coordenates-properly-for-map-visualitzation-on-kibana/207113 "2019-11-08T12:33:24Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![HikariNTB](https://avatars.discourse-cdn.com/v4/letter/h/bb73d2/32.png) [@HikariNTB](https://discuss.elastic.co/u/HikariNTB)
#### Post date: [November 8, 2019, 12:33pm UTC](https://discuss.elastic.co/t/dont-know-how-to-make-elasticsearch-recognise-the-location-coordenates-properly-for-map-visualitzation-on-kibana/207113/1 "2019-11-08T12:33:24Z")

</div>

Hi,

Recently, I had to face a project where I had to locate on a map the different issues we have.

I've been trying for a week how to do it with logstash but I don't know why is not working...

Here you have my ".conf":

```
input {
  file {
  path => "/opt/test05.csv"
  sincedb_path => "/dev/null"
  mode => "read"
  ignore_older => "29 d"
  file_completed_action => "delete"
  }
}

filter {
  grok {
    patterns_dir => ["/opt/paterns"]
    match => {
      "message" => "^%{DATA:errorid};%{USERNAME:errorcode};%{USERNAME:clientid};%{DATA:latlon:longitude};%{DATA:latlon:latitude};%{INT:connec_status};%{MINEDATE:erroruptime};%{IPV4:ip}$"
    }
  }
  geoip {
    source => "latlon"
    target => "geoip"
    add_field => ["[geoip][coordinates]", "%{[geoip][longitude]}" ]
    add_field => ["[geoip][coordinates]", "%{[geoip][latitude]}" ]
  }
  mutate {
    convert => {
      "[connec_status]" => "integer"
      "[latlon]" => "float"
      "[geoip][latitude]" => "float"
      "[geoip][longitude]" => "float"
      "[geoip][coordinates]" => "float"
    }
    copy => {
      "p05latlon" => "[geoip][coordinates]"
    }
  }
  date {
    match => ["erroruptime", "dd/MM/YYYY HH:mm"]
    locale => en
    remove_field => ["timestamp"]
  }
  if ("_grokparsefailure" in [tags]) {
    drop{}
  }
}

output {
  elasticsearch {
    hosts => ["127.0.0.1:9200"]
    index => "test05"
  }
  stdout {}
}

```

The data I introduce:

```
829616001458;CD0678-TR1;34678792401;63.607171; 10.801033;1;24/10/2019 9:50;1XX.2X.1XX.1XX
829616001468;S68254-TR2;34686339212;63.584253; 10.736047;1;24/10/2019 15:20;1XX.2X.1XX.5XX
829616001486;S53348-TR1;34686334689;63.789019; 9.709261;1;24/10/2019 14:44;1XX.2X.1XX.5X
829616001498;S23192-TR1;34662624163;63.839019; 9.939261;1;24/10/2019 9:31;1XX.2X.1XX.2XX

```

And Kibana:

 ![kibana_result](https://us1.discourse-cdn.com/elastic/original/3X/3/1/3132d3bad3e1231c60537eabe92b719624f7bb3c.png)  
(I covered or edit some sensible data that has nothing to do with the error)

The thing is that it says the location is on Arabia Saudi but is not even close... and for some reason there is no parameter that recognize the location for the Kibanas "visualization".

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/3/c3438f5ad1226a0f96ab150624d0854c6213aadd.png)

I know maybe this can look stupid issue but as I could not solve it with what I found on the net, I ask it here.

Thank you.

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [November 8, 2019, 1:04pm UTC](https://discuss.elastic.co/t/dont-know-how-to-make-elasticsearch-recognise-the-location-coordenates-properly-for-map-visualitzation-on-kibana/207113/2 "2019-11-08T13:04:12Z")

</div>

Hi @HikariNTB

You need to create a mapping with geo\_point data type first before you index the data.

See an explanation [here](https://discuss.elastic.co/t/convert-lat-and-long-to-geohash/197631/4)

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [November 8, 2019, 3:21pm UTC](https://discuss.elastic.co/t/dont-know-how-to-make-elasticsearch-recognise-the-location-coordenates-properly-for-map-visualitzation-on-kibana/207113/3 "2019-11-08T15:21:04Z")

</div>

> [@HikariNTB](#):
>
> The thing is that it says the location is on Arabia Saudi but is not even close

The quality of the geolocation data available for free is not very good.

---

<div class="post-metadata">

### Author: ![HikariNTB](https://avatars.discourse-cdn.com/v4/letter/h/bb73d2/32.png) [@HikariNTB](https://discuss.elastic.co/u/HikariNTB)
#### Post date: [November 25, 2019, 4:01pm UTC](https://discuss.elastic.co/t/dont-know-how-to-make-elasticsearch-recognise-the-location-coordenates-properly-for-map-visualitzation-on-kibana/207113/4 "2019-11-25T16:01:58Z")

</div>

Yes, thank you so much.

My main problem was to think I need "geoip" on my conf file for logstash and the fact I didn't do mapping for this.

So if anyone have the same problem where you need to geolocate some point and you have no ip related to that (like for a housing database or log).

You just need to apply this mapping and then the conf doc like this:

> PUT test09  
> {  
> "mappings": {  
> "properties": {  
> "location": {  
> "type": "geo\_point"  
> }  
> }  
> }  
> }

> input {  
> file {  
> path =\> "/opt/test09.csv"  
> sincedb\_path =\> "/dev/null"  
> mode =\> "read"  
> ignore\_older =\> "29 d"  
> file\_completed\_action =\> "delete"  
> }  
> }
> 
> filter {  
> grok {  
> patterns\_dir =\> ["/opt/paterns"]  
> match =\> {  
> "message" =\> "^%{DATA:errorid};%{USERNAME:errorcode};%{USERNAME:clientid};%{DATA:location};%{INT:connec\_status};%{MINEDATE:erroruptime};%{IPV4:ip}$"  
> }  
> }  
> date {  
> match =\> ["erroruptime", "dd/MM/YYYY HH:mm"]  
> locale =\> en  
> remove\_field =\> ["timestamp"]  
> }  
> if ("\_grokparsefailure" in [tags]) {  
> drop{}  
> }  
> }
> 
> output {  
> elasticsearch {  
> hosts =\> ["127.0.0.1:9200"]  
> index =\> "test09"  
> }  
> stdout {}  
> }

Hope this can help anyone!

---

<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: [December 23, 2019, 4:02pm UTC](https://discuss.elastic.co/t/dont-know-how-to-make-elasticsearch-recognise-the-location-coordenates-properly-for-map-visualitzation-on-kibana/207113/5 "2019-12-23T16:02:05Z")

</div>

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