# Logstash configuration geo\_point mapping not apply

**URL:** https://discuss.elastic.co/t/logstash-configuration-geo-point-mapping-not-apply/156374
**Category:** Logstash
**Created:** [November 13, 2018, 3:07am UTC](https://discuss.elastic.co/t/logstash-configuration-geo-point-mapping-not-apply/156374 "2018-11-13T03:07:22Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![GibbsKim](https://avatars.discourse-cdn.com/v4/letter/g/4af34b/32.png) [@GibbsKim](https://discuss.elastic.co/u/GibbsKim)
#### Post date: [November 13, 2018, 3:07am UTC](https://discuss.elastic.co/t/logstash-configuration-geo-point-mapping-not-apply/156374/1 "2018-11-13T03:07:23Z")

</div>

hi guys, I'm ELK 6.3.1 user.  
I have question about geo\_mapping in logstash.

I was using logstash .conf file for CSV file and Json template file. (was in 5.2.2)  
Below is a part of configuration file.

```
input {
    file {
          path => "~/*.csv"
          start_position => "beginning"
          sincedb_path => "/dev/null"
    }
}

filter {
    csv {
              separator => ","
              columns => [~, "HV_Lat", "HV_Lon", ~]
              skip_empty_columns => true
              remove_field => [~]
              convert => {
                                     ~
                                     "HV_Lat" => "float"
                                     "HV_Lon" => "float"
                                     ~
                                  }
            }

              date {
                           match => []
                           target => []
                        }

               mutate { rename => {"HV_Lat" => "[location][lat]"}}
               mutate { rename => {"HV_Lat" => "[location][lon]"}}   
}

output {
       elasticsearch {
             hosts => "http://localhost:9000"
             index => "x10_2018"
             template=> "./template.json"
       }
        ~
}

```

my template file "template.json" is below.

```
{
    "mappings":
    {
	"*_2018":
	{
		"doc":
		{
		    "properties":
		    {
		         "location":
		        {
				"properties":
				{
					"lat":
					{
						"type": "float"
					},
					"location":
					{
						"type": "geo_point"
					},
					"lon":
					{
						"type": "float"
					}
				}
		        }
		    }
        }
	}
    }
}

```

When I was logstash processing configure file with json template, I can make index on Kibana, but cannot mapping geo\_point.

How am I mapping geo\_point use template file?

(not mapping geo\_point result)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/a/4a93d1bcbcd27e8dd84dc3eaa4816143c29b861e.png)

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [November 13, 2018, 7:43am UTC](https://discuss.elastic.co/t/logstash-configuration-geo-point-mapping-not-apply/156374/2 "2018-11-13T07:43:25Z")

</div>

The full `location` field should be mapped as `geo_point` and you should not map the individual `lat` and `lon` fields:

```auto
{
...
  "doc": {
    "properties": {
      "location": {
        "type": "geo_point"
      }
    }
  }
...
}

```

You can see an example in [this blog post](https://www.elastic.co/blog/geoip-in-the-elastic-stack).

---

<div class="post-metadata">

### Author: ![GibbsKim](https://avatars.discourse-cdn.com/v4/letter/g/4af34b/32.png) [@GibbsKim](https://discuss.elastic.co/u/GibbsKim)
#### Post date: [November 13, 2018, 8:32am UTC](https://discuss.elastic.co/t/logstash-configuration-geo-point-mapping-not-apply/156374/3 "2018-11-13T08:32:16Z")

</div>

I appreciate your reply Christian.

I did try it a few minutes before, but unfortunately still not mapping yet.

below is modified json

> {  
> "mappings":  
> {  
> "\*\_2018":  
> {  
> "doc":  
> {  
> "properties":  
> {  
> "location":  
> {  
> "type": "geo\_point"  
> }  
> }  
> }  
> }  
> }  
> }

below is same result about mapping failure

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/d/1db31079a28ae2dc034e056b5b6e7054a729ee19.png)

If you don't mine, could you tell me how to edit for geo\_point mapping?..

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [November 13, 2018, 9:14am UTC](https://discuss.elastic.co/t/logstash-configuration-geo-point-mapping-not-apply/156374/4 "2018-11-13T09:14:45Z")

</div>

As you can not change existing mappings you need to create a new index with the updated mapping. Did you do that? What is the current mapping for that field in the index?

---

<div class="post-metadata">

### Author: ![GibbsKim](https://avatars.discourse-cdn.com/v4/letter/g/4af34b/32.png) [@GibbsKim](https://discuss.elastic.co/u/GibbsKim)
#### Post date: [November 13, 2018, 9:28am UTC](https://discuss.elastic.co/t/logstash-configuration-geo-point-mapping-not-apply/156374/5 "2018-11-13T09:28:04Z")

</div>

In my case, deleted exist index (x10\_2018) first.  
next I did logstash again same index with upper template. (modified json)

however, I still saw geo\_point mapping not completed.

---

<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: [December 11, 2018, 9:28am UTC](https://discuss.elastic.co/t/logstash-configuration-geo-point-mapping-not-apply/156374/6 "2018-12-11T09:28:09Z")

</div>

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