# How to construct geo\_point field from separate fields of latitude and longitude for Kibana 7.6?

**URL:** <https://discuss.elastic.co/t/how-to-construct-geo-point-field-from-separate-fields-of-latitude-and-longitude-for-kibana-7-6/225847>\
**Category:** Logstash\
**Created:** [March 31, 2020, 11:57am UTC](https://discuss.elastic.co/t/how-to-construct-geo-point-field-from-separate-fields-of-latitude-and-longitude-for-kibana-7-6/225847 "2020-03-31T11:57:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yassine\_belhajali](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yassine_belhajali/32/65383_2.png) [@yassine\_belhajali](https://discuss.elastic.co/u/yassine_belhajali)\
**Post date:** [March 31, 2020, 11:57am UTC](https://discuss.elastic.co/t/how-to-construct-geo-point-field-from-separate-fields-of-latitude-and-longitude-for-kibana-7-6/225847/1 "2020-03-31T11:57:43Z")

</div>

From input csv data I have 2 fields of location - lat and long.  
How can I construct a geo\_point location field to create map visualization in logstash config (version 7.6)?

Thank you.  
' ' ' '

```
filter {

csv{
separator => ";"
columns => ["Province/State","Country/Region","Lat","Long","Date","Cases","Deaths"]
skip_empty_columns => "true"
skip_header => "true"
}

mutate{
convert => { "Cases" => "integer" }
convert => { "Deaths" => "integer" }
}

mutate{
convert => { "Lat" => "float" }
convert => { "Long" => "float" }
}

date {
match => ["Date", "dd/MM/yyyy"]
timezone => "UTC"
target => "@timestamp"
}
}
```

---

<div class="post-metadata">

**Author:** ![Mike.Barretta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mike.barretta/32/16688_2.png) [@Mike.Barretta](https://discuss.elastic.co/u/Mike.Barretta)\
**Post date:** [April 1, 2020, 3:41pm UTC](https://discuss.elastic.co/t/how-to-construct-geo-point-field-from-separate-fields-of-latitude-and-longitude-for-kibana-7-6/225847/2 "2020-04-01T15:41:32Z")

</div>

@yassine_belhajali you need to do two things:

1. Define a `geo_point` field in the mapping of the index set to receive this data
2. Concatenate the lat/lon pair into a single field that adheres to one the [five allowable formats](https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-point.html).

For #2, I tend to just do something like:

```auto
mutate{
  add_field => {"location" => "%{lat},%{lon}"}
  remove_field => ["lat", "lon"]
}

```

---

<div class="post-metadata">

**Author:** ![yassine\_belhajali](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yassine_belhajali/32/65383_2.png) [@yassine\_belhajali](https://discuss.elastic.co/u/yassine_belhajali)\
**Post date:** [April 1, 2020, 5:23pm UTC](https://discuss.elastic.co/t/how-to-construct-geo-point-field-from-separate-fields-of-latitude-and-longitude-for-kibana-7-6/225847/3 "2020-04-01T17:23:44Z")

</div>

I added location field in the mapping using a template, changed my code like this :

```
 mutate{
    rename => {
	"Long" => "[locations][lon]"
	"Lat" => "[locations][lat]"
    }
 }

```

Then it works ✌  
Thanks.

---

<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:** [April 29, 2020, 5:28pm UTC](https://discuss.elastic.co/t/how-to-construct-geo-point-field-from-separate-fields-of-latitude-and-longitude-for-kibana-7-6/225847/4 "2020-04-29T17:28:20Z")

</div>

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