# Unable to create geo points

**URL:** <https://discuss.elastic.co/t/unable-to-create-geo-points/302130>\
**Category:** Logstash\
**Created:** [April 11, 2022, 3:42pm UTC](https://discuss.elastic.co/t/unable-to-create-geo-points/302130 "2022-04-11T15:42:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dhinesh\_Kumar\_N](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dhinesh_kumar_n/32/104248_2.png) [@Dhinesh\_Kumar\_N](https://discuss.elastic.co/u/Dhinesh_Kumar_N)\
**Post date:** [April 11, 2022, 3:42pm UTC](https://discuss.elastic.co/t/unable-to-create-geo-points/302130/1 "2022-04-11T15:42:17Z")

</div>

Hi,

```
 Can any one help to configure geo points for the data which I have, I'm using live data streaming(filebeat), I the logstash configuration I have added location feed,

```

config:  
geoip {  
database =\> "GeoIP2-City.mmdb"  
source =\> "IP"  
target =\> "geoip"  
fields =\> ["city\_name", "country\_name", "continent\_code", "country\_code2", "location", "region\_name", "region\_code"]  
}

but for location output, am I getting geolocation as below

"location": {  
"lat": 10.8326,  
"lon": 106.6581  
},

and in data view it formatted as float data type and not geo\_points

geoip.geo.location.lat 20.006  
geoip.geo.location.lon 77.006

---

<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:** [April 11, 2022, 6:01pm UTC](https://discuss.elastic.co/t/unable-to-create-geo-points/302130/2 "2022-04-11T18:01:06Z")

</div>

Fact: If you set `ecs_compatibility => "disabled"` then the default value for target is geoip and you will get

```
     "srcIp" => "161.170.230.170",
     "geoip" => {
    "location" => {
        "lon" => -97.822,
        "lat" => 37.751
    }
},

```

When ecs compability is disabled, the [default template](https://github.com/logstash-plugins/logstash-output-elasticsearch/blob/48ddb890ce350afa3ddbc8602bb282c9c185aebf/lib/logstash/outputs/elasticsearch/templates/ecs-disabled/elasticsearch-8x.json#L34) that an Elasticsearch output may install will contain a mapping that makes that a geo\_point.

Speculation: When ecs\_compatibility is enabled then target is a required field unless source has one of a small set of values. As such, since it is unclear what the target of the filter is going to be, the ecs compatible templates (which I cannot find) may not have any fields be a geo\_point by default.

Answer: you need to add a [template](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html) or otherwise [set the mapping](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html) on the index. Note that you cannot change the type of a field once created. You will need to create a new index.

---

<div class="post-metadata">

**Author:** ![Dhinesh\_Kumar\_N](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dhinesh_kumar_n/32/104248_2.png) [@Dhinesh\_Kumar\_N](https://discuss.elastic.co/u/Dhinesh_Kumar_N)\
**Post date:** [April 12, 2022, 7:56am UTC](https://discuss.elastic.co/t/unable-to-create-geo-points/302130/3 "2022-04-12T07:56:10Z")

</div>

> [@Badger](#):
>
> ecs\_compatibility

Thank you, now am able to create map with the geo points, I have created new template with geo points mappings.

---

<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:** [May 10, 2022, 7:56am UTC](https://discuss.elastic.co/t/unable-to-create-geo-points/302130/4 "2022-05-10T07:56:39Z")

</div>

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