# Add geo point in Elastic

**URL:** <https://discuss.elastic.co/t/add-geo-point-in-elastic/280005>\
**Category:** Logstash\
**Tags:** docker\
**Created:** [July 29, 2021, 4:52pm UTC](https://discuss.elastic.co/t/add-geo-point-in-elastic/280005 "2021-07-29T16:52:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![klynxe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/klynxe/32/92328_2.png) [@klynxe](https://discuss.elastic.co/u/klynxe)\
**Post date:** [July 29, 2021, 4:52pm UTC](https://discuss.elastic.co/t/add-geo-point-in-elastic/280005/1 "2021-07-29T16:52:17Z")

</div>

Hi everyone,  
I use ELK and filebeat. I send a lot of logs with different fields.  
logstash config:

```auto
input {
    beats {
      port => 5044
      include_codec_tag => false
    }
}

filter {
  if [type] == "json" {
    json {
      source => "message"
      target => "msg"
    }
    mutate {
      remove_field => ["msg.ecs.version", "ecs.version", "@version"]
    }
  }
  if [type] != "json" {
    grok {
      match => {
        message => ["time=\"%{TIMESTAMP_ISO8601:time}\""]
        }
      }
    date {
      match => ["time", "YYYY-MM-dd'T'HH:mm:ssZZ"]
      target => "time"
    }
  }
}

output {
  elasticsearch {
    hosts => ["elasticsearch:9200"]
    sniffing => true
    manage_template => false
    index => "%{[source][project]}-%{[source][application]}-%{+YYYY.MM.dd}"
  }
}

```

Some of my message contain location

```auto
{
"location": {
    "lat": 11.11,
    "lon": 22.22
  }
}

```

In elastic I can see my location, ( `msg.location.lat` and `msg.location.lon` ), but I don't know how convert my location to geo\_point. As I understand current index mapping is created by logstash plugin or by elastic search by default template. What and where shoud I write to use my location as geo\_point?

---

<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:** [August 26, 2021, 4:52pm UTC](https://discuss.elastic.co/t/add-geo-point-in-elastic/280005/2 "2021-08-26T16:52:30Z")

</div>

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