# Location type geo\_point

**URL:** <https://discuss.elastic.co/t/location-type-geo-point/262059>\
**Category:** Logstash\
**Created:** [January 25, 2021, 6:19am UTC](https://discuss.elastic.co/t/location-type-geo-point/262059 "2021-01-25T06:19:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elves\_Ribeiro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elves_ribeiro/32/82826_2.png) [@Elves\_Ribeiro](https://discuss.elastic.co/u/Elves_Ribeiro)\
**Post date:** [January 25, 2021, 6:19am UTC](https://discuss.elastic.co/t/location-type-geo-point/262059/1 "2021-01-25T06:19:59Z")

</div>

# Hi,

## I am trying to create a map on my environment, but I am not able to create the field location type geo\_point. I am using version 7.10.2

## My logstash conf

```bash

 geoip {

  source => "ip_client"

}

mutate {

add_field => ["[geoip][location]" , "%{longitude}" ]

add_field => ["[geoip][location]" , "%{latitude}" ]

}

```

## My template

```bash

{

  "index_templates" : [

    {

      "name" : "big_ip",

      "index_template" : {

        "index_patterns" : [

          "big_ip-waf-logs-*"

        ],

        "template" : {

          "settings" : {

            "index" : {

              "number_of_shards" : "1"

            }

          },

          "mappings" : {

            "properties" : {

              "location" : {

                "type" : "geo_point"

              }

            }

          },

          "aliases" : {

            "mydata" : { }

          }

        },

        "composed_of" : [],

        "priority" : 200,

        "version" : 3,

        "_meta" : {

          "description" : "Big IP WAF"

        }

      }

    }

  ]

}

```

##The error:

```bash

[2021-01-25T06:11:02,319][WARN][logstash.outputs.elasticsearch][main][ebd65197aef2322dde6d849c25af897d96eba0752661fccf151896a01975c723] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"big_ip-waf-logs-2021.01.25", :routing=>nil, :_type=>"_doc"}, #<LogStash::Event:0x3df7f5a7>], :response=>{"index"=>{"_index"=>"big_ip-waf-logs-2021.01.25", "_type"=>"_doc", "_id"=>"zUAqOHcBdgZ1N8nvwsIf", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"mapper [geoip.location] cannot be changed from type [float] to [text]"}}}}

{

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 26, 2021, 9:46pm UTC](https://discuss.elastic.co/t/location-type-geo-point/262059/2 "2021-01-26T21:46:54Z")

</div>

Welcome to our community! 😃

> [@Elves\_Ribeiro](#):
>
> ```auto
> mutate {
> 
> add_field => ["[geoip][location]" , "%{longitude}" ]
> 
> add_field => ["[geoip][location]" , "%{latitude}" ]
> 
> }
> 
> ```

You shouldn't need to do this if the geoip filter is working properly.

> [@Elves\_Ribeiro](#):
>
> `mapper [geoip.location] cannot be changed from type [float] to [text]`

Though that would suggest that the filter is not working for some reason.

Can you post one of the events that is in Elasticsearch that Logstash has processed?

---

<div class="post-metadata">

**Author:** ![Elves\_Ribeiro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elves_ribeiro/32/82826_2.png) [@Elves\_Ribeiro](https://discuss.elastic.co/u/Elves_Ribeiro)\
**Post date:** [January 31, 2021, 10:48pm UTC](https://discuss.elastic.co/t/location-type-geo-point/262059/3 "2021-01-31T22:48:12Z")

</div>

Hi,

I solved the problem by changing my template:

```bash
PUT _index_template/test
{
  "index_patterns": ["test**"],
  "template": {
    "settings": {
      "number_of_shards": 1
    },
  "mappings": {
  "properties": {
     "geoip": {
        "dynamic": true,
    "properties": {
      "ip": {
            "type": "ip"
          },
          "latitude": {
            "type": "half_float"
          },
          "location": {
            "type": "geo_point"
          },
          "longitude": {
            "type": "half_float"
          }
        }
      }
  },
    "aliases": {
      "mydata": { }
    }
  },
  "priority": 200,
  "version": 3,
  "_meta": {
    "description": "Test"
  }

```

My logstash file:

```bash

 geoip {

  source => "ip_client"

}

```

---

<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:** [February 28, 2021, 10:48pm UTC](https://discuss.elastic.co/t/location-type-geo-point/262059/4 "2021-02-28T22:48:38Z")

</div>

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