# Please help me to deal with geo\_point in ES 2.1 and logstash 2.1. I am unable to set mapping of location as I use to do in old version using \_river

**URL:** <https://discuss.elastic.co/t/please-help-me-to-deal-with-geo-point-in-es-2-1-and-logstash-2-1-i-am-unable-to-set-mapping-of-location-as-i-use-to-do-in-old-version-using--river/39872>\
**Category:** Logstash\
**Created:** [January 22, 2016, 12:09pm UTC](https://discuss.elastic.co/t/please-help-me-to-deal-with-geo-point-in-es-2-1-and-logstash-2-1-i-am-unable-to-set-mapping-of-location-as-i-use-to-do-in-old-version-using--river/39872 "2016-01-22T12:09:29Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrizwan](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@mrizwan](https://discuss.elastic.co/u/mrizwan)\
**Post date:** [January 22, 2016, 12:09pm UTC](https://discuss.elastic.co/t/please-help-me-to-deal-with-geo-point-in-es-2-1-and-logstash-2-1-i-am-unable-to-set-mapping-of-location-as-i-use-to-do-in-old-version-using--river/39872/1 "2016-01-22T12:09:29Z")

</div>

I used ES old versions with \_river to fetch data. For location i do following in mapping

"Location": {"type": "geo\_point"},

and my data set , i return location.lat and location.lon.

I am unable to set type geo\_point in ES 2.1 and Logstash 2.1.

Please help me regarding this. I want to use it in KIBANA.

---

<div class="post-metadata">

**Author:** ![rajkamalkool6](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@rajkamalkool6](https://discuss.elastic.co/u/rajkamalkool6)\
**Post date:** [January 22, 2016, 12:16pm UTC](https://discuss.elastic.co/t/please-help-me-to-deal-with-geo-point-in-es-2-1-and-logstash-2-1-i-am-unable-to-set-mapping-of-location-as-i-use-to-do-in-old-version-using--river/39872/2 "2016-01-22T12:16:18Z")

</div>

What is your index name you setting it in Logstash?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [January 23, 2016, 5:12pm UTC](https://discuss.elastic.co/t/please-help-me-to-deal-with-geo-point-in-es-2-1-and-logstash-2-1-i-am-unable-to-set-mapping-of-location-as-i-use-to-do-in-old-version-using--river/39872/3 "2016-01-23T17:12:48Z")

</div>

More details please. What do your events look like, for example? The output of a `stdout { codec => rubydebug }` output would be helpful.

---

<div class="post-metadata">

**Author:** ![mrizwan](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@mrizwan](https://discuss.elastic.co/u/mrizwan)\
**Post date:** [January 28, 2016, 4:38pm UTC](https://discuss.elastic.co/t/please-help-me-to-deal-with-geo-point-in-es-2-1-and-logstash-2-1-i-am-unable-to-set-mapping-of-location-as-i-use-to-do-in-old-version-using--river/39872/4 "2016-01-28T16:38:10Z")

</div>

I have multiple indexes. Let say my index name is 'commission'.

---

<div class="post-metadata">

**Author:** ![mrizwan](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@mrizwan](https://discuss.elastic.co/u/mrizwan)\
**Post date:** [January 28, 2016, 4:53pm UTC](https://discuss.elastic.co/t/please-help-me-to-deal-with-geo-point-in-es-2-1-and-logstash-2-1-i-am-unable-to-set-mapping-of-location-as-i-use-to-do-in-old-version-using--river/39872/5 "2016-01-28T16:53:21Z")

</div>

If i am not wrong, You are asking about my logstash config file output event !

output {

```
if [type] == "A" {
    elasticsearch {
        hosts => "107.100.100.111"
        index => "test"
        document_type => "test_report"
        document_id => "%{uid}" 
    }    
}
if [type] == "B" {
elasticsearch {
    hosts => "107.100.100.111"
        index => "test1"
        document_type => "test1_report"
        document_id => "%{uid}"
    }    
}

```

stdout { codec =\> rubydebug }  
}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [January 28, 2016, 5:50pm UTC](https://discuss.elastic.co/t/please-help-me-to-deal-with-geo-point-in-es-2-1-and-logstash-2-1-i-am-unable-to-set-mapping-of-location-as-i-use-to-do-in-old-version-using--river/39872/6 "2016-01-28T17:50:45Z")

</div>

> If i am not wrong, You are asking about my logstash config file output event !

No, I wanted to know what your events look like, preferably as presented by the `stdout { codec => rubydebug }` output already in your config file.

---

<div class="post-metadata">

**Author:** ![rajkamalkool6](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@rajkamalkool6](https://discuss.elastic.co/u/rajkamalkool6)\
**Post date:** [February 2, 2016, 12:48pm UTC](https://discuss.elastic.co/t/please-help-me-to-deal-with-geo-point-in-es-2-1-and-logstash-2-1-i-am-unable-to-set-mapping-of-location-as-i-use-to-do-in-old-version-using--river/39872/7 "2016-02-02T12:48:45Z")

</div>

@mrizwan.  
Change your index name something like "logstash-commision", bec geo\_point will work on the index name begin with logstash-

---

<div class="post-metadata">

**Author:** ![rajkamalkool6](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@rajkamalkool6](https://discuss.elastic.co/u/rajkamalkool6)\
**Post date:** [February 2, 2016, 1:46pm UTC](https://discuss.elastic.co/t/please-help-me-to-deal-with-geo-point-in-es-2-1-and-logstash-2-1-i-am-unable-to-set-mapping-of-location-as-i-use-to-do-in-old-version-using--river/39872/8 "2016-02-02T13:46:28Z")

</div>

Make sure you have used the geopoint filter in your Logstash config.

---

<div class="post-metadata">

**Author:** ![mrizwan](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@mrizwan](https://discuss.elastic.co/u/mrizwan)\
**Post date:** [February 2, 2016, 4:55pm UTC](https://discuss.elastic.co/t/please-help-me-to-deal-with-geo-point-in-es-2-1-and-logstash-2-1-i-am-unable-to-set-mapping-of-location-as-i-use-to-do-in-old-version-using--river/39872/9 "2016-02-02T16:55:06Z")

</div>

@rajkamalcool6

What should be the geopoint filter ?

---

<div class="post-metadata">

**Author:** ![rajkamalkool6](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@rajkamalkool6](https://discuss.elastic.co/u/rajkamalkool6)\
**Post date:** [February 3, 2016, 6:58am UTC](https://discuss.elastic.co/t/please-help-me-to-deal-with-geo-point-in-es-2-1-and-logstash-2-1-i-am-unable-to-set-mapping-of-location-as-i-use-to-do-in-old-version-using--river/39872/10 "2016-02-03T06:58:15Z")

</div>

You need to mention this inside your filter section, then only geo point will get created.

> geoip {  
> source =\> "field name containing IP value"  
> }

and also your index name should be in the following format "logstash-myindex"

---

<div class="post-metadata">

**Author:** ![mrizwan](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@mrizwan](https://discuss.elastic.co/u/mrizwan)\
**Post date:** [February 3, 2016, 2:40pm UTC](https://discuss.elastic.co/t/please-help-me-to-deal-with-geo-point-in-es-2-1-and-logstash-2-1-i-am-unable-to-set-mapping-of-location-as-i-use-to-do-in-old-version-using--river/39872/11 "2016-02-03T14:40:20Z")

</div>

@rajkamalcool6

I am not dealing with IPs here and my concern is about geopoint not geoip .  
I am dealing with Longitudes and Latitudes. I am picking Long and Lat in my  
sql data set. There are two columns, Latitude and Longitude so how should I  
use them in my filter.

---

<div class="post-metadata">

**Author:** ![rajkamalkool6](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@rajkamalkool6](https://discuss.elastic.co/u/rajkamalkool6)\
**Post date:** [February 4, 2016, 6:00am UTC](https://discuss.elastic.co/t/please-help-me-to-deal-with-geo-point-in-es-2-1-and-logstash-2-1-i-am-unable-to-set-mapping-of-location-as-i-use-to-do-in-old-version-using--river/39872/12 "2016-02-04T06:00:56Z")

</div>

I hope you can't map Longitudes and Latitudes separately. If you pass the IP field in geoip filter it automatically fetch the latitude and longitude field from the ip address.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 4, 2016, 6:34am UTC](https://discuss.elastic.co/t/please-help-me-to-deal-with-geo-point-in-es-2-1-and-logstash-2-1-i-am-unable-to-set-mapping-of-location-as-i-use-to-do-in-old-version-using--river/39872/13 "2016-02-04T06:34:52Z")

</div>

> I hope you can't map Longitudes and Latitudes separately. If you pass the IP field in geoip filter it automatically fetch the latitude and longitude field from the ip address.

@rajkamalkool6, again, there is no IP address here so the geoip filter isn't useful. Enough about the geoip filter.

@mrizwan, there are two things at play here: the mapping of the field in Elasticsearch and what the document you send to Elasticsearch. The ES documentation about the geo\_point type describes what fields must look like to be convertible to geo\_point values. Make sure you comply with those rules. Also check the mapping if your index so that the target field is mapped as geo\_point.

---

<div class="post-metadata">

**Author:** ![mrizwan](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@mrizwan](https://discuss.elastic.co/u/mrizwan)\
**Post date:** [February 8, 2016, 5:40pm UTC](https://discuss.elastic.co/t/please-help-me-to-deal-with-geo-point-in-es-2-1-and-logstash-2-1-i-am-unable-to-set-mapping-of-location-as-i-use-to-do-in-old-version-using--river/39872/14 "2016-02-08T17:40:45Z")

</div>

@magnusbaeck - Thanks for the explanation , I have completely understood your point.

What I am doing is, I have mapped that field like this in Elasticsearch " Location": {"type": "geo\_point"} " and according to the ES compliance, geo\_point requires two columns in data set like these  
location.lat,  
location.lon  
Now, what I have to do to set these two columns values to geo\_ip  
I think I have to do something like this in our filter  
grok{  
geo\_ip =\> [location.lat , location.long]  
}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 9, 2016, 8:22am UTC](https://discuss.elastic.co/t/please-help-me-to-deal-with-geo-point-in-es-2-1-and-logstash-2-1-i-am-unable-to-set-mapping-of-location-as-i-use-to-do-in-old-version-using--river/39872/15 "2016-02-09T08:22:38Z")

</div>

For the third time, please show the output of the `stdout { codec => rubydebug }` output already in your config file. I can't suggest what you should do if I don't know what your events look like.

---

<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, 5:12am UTC](https://discuss.elastic.co/t/please-help-me-to-deal-with-geo-point-in-es-2-1-and-logstash-2-1-i-am-unable-to-set-mapping-of-location-as-i-use-to-do-in-old-version-using--river/39872/16 "2017-07-06T05:12:36Z")

</div>


