# Problem to convert lat and long for Kibana

**URL:** <https://discuss.elastic.co/t/problem-to-convert-lat-and-long-for-kibana/87449>\
**Category:** Logstash\
**Created:** [May 29, 2017, 12:50pm UTC](https://discuss.elastic.co/t/problem-to-convert-lat-and-long-for-kibana/87449 "2017-05-29T12:50:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlorianMtin](https://avatars.discourse-cdn.com/v4/letter/f/53a042/32.png) [@FlorianMtin](https://discuss.elastic.co/u/FlorianMtin)\
**Post date:** [May 29, 2017, 12:50pm UTC](https://discuss.elastic.co/t/problem-to-convert-lat-and-long-for-kibana/87449/1 "2017-05-29T12:50:26Z")

</div>

Hello,  
I'm using Elastic Stack since few days and I'm having some difficulties to convert latitude and longitude into geo\_point type, I also try many solution on this forum but I can't resolve my problem 😕 . I work on Logstash 5.4 , there is my conf file :

```
input {
  file{
    path => "C:\Users\martinfm\Documents\ELK\gps_again2.txt"
    start_position => "beginning"
    type => "caisse"
  }
}

filter{
    csv{
        separator => ","
        columns => ["numcr","nomcaisse","latitude","longitude"]
        }
		
	geoip { 
        source => "caissegps" 
        target => "geoip" 
        add_field => ["[geoip][location]", "%{[longitude]}" ] 
        add_field => ["[geoip][location]", "%{[latitude]}" ] 
      } 
      mutate {
        convert => ["[geoip][location]", "float" ]
      }
		
       
}

output {
  elasticsearch{ 
      hosts => "http://localhost:9200"
      index => "sfclog_gps"
	  template => "C:\Users\martinfm\Documents\ELK\logstash-5.4.0\etc\templates\project.json"
	  template_name => "gps_logstash"
	  template_overwrite => true
        }                   
} 

```

And there is my template used :

```
{ 
    "template" : "gps_logstash", 
    "settings" : { "index.refresh_interval" : "60s" }, 
    "mappings" : { 
        "_default_" : { 
            "_all" : { "enabled" : false }, 
            "dynamic_templates" : [{ 
              "message_field" : { 
                "match" : "message", 
                "match_mapping_type" : "string", 
                "mapping" : { "type" : "string", "index" : "not_analyzed" } 
              } 
            }, { 
              "string_fields" : { 
                "match" : "*", 
                "match_mapping_type" : "string", 
                "mapping" : { "type" : "string", "index" : "not_analyzed" } 
              } 
            }],
			"properties" : {
				"@timestamp" : { "type" : "date", "format" : "dateOptionalTime" }, 
				"@version" : { "type" : "integer", "index" : "not_analyzed" }, 
				"numcr" : { "type" : "integer" }, 
				"nomcaisse" : { "type" : "string"},
				"geoip" : { "type" : "object", "properties" : { "location" : { "type" : "geo_point" } } }
			}
		}
	}
}

```

I saw this error on kibana : No Compatible Fields: The "sfclog\_gps" index pattern does not contain any of the following field types: geo\_point

And I notice my field numcr isn't an integer on kibana : host.keyword string

Did logstash don't use my template? If I try this : `curl localhost:9200/_template/gps_logstash?pretty` , I find my custom template, I don't understand.

Any idea what I am doing wrong here? Regards, Florian.

Sorry for my poor English ☹

---

<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:** [May 29, 2017, 7:05pm UTC](https://discuss.elastic.co/t/problem-to-convert-lat-and-long-for-kibana/87449/2 "2017-05-29T19:05:29Z")

</div>

Because of

```
"template" : "gps_logstash", 

```

in your index template it'll only apply to indexes named "gps\_logstash", but you're calling your index "sfclog\_gps".

---

<div class="post-metadata">

**Author:** ![FlorianMtin](https://avatars.discourse-cdn.com/v4/letter/f/53a042/32.png) [@FlorianMtin](https://discuss.elastic.co/u/FlorianMtin)\
**Post date:** [May 30, 2017, 7:13am UTC](https://discuss.elastic.co/t/problem-to-convert-lat-and-long-for-kibana/87449/3 "2017-05-30T07:13:01Z")

</div>

Oh thanks it work now I have my point on the map, but I still have a little question about the template.  
How to use template if you named index like that : `index => "example-%{+YYYY.MM.dd}"`  
And why it not work if I put this on my conf : `template_name => "my_template"`

---

<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:** [May 30, 2017, 7:45am UTC](https://discuss.elastic.co/t/problem-to-convert-lat-and-long-for-kibana/87449/4 "2017-05-30T07:45:49Z")

</div>

With `index => "example-%{+YYYY.MM.dd}"` in your Logstash configuration you need `"template": "example-*"` in your index template.

---

<div class="post-metadata">

**Author:** ![FlorianMtin](https://avatars.discourse-cdn.com/v4/letter/f/53a042/32.png) [@FlorianMtin](https://discuss.elastic.co/u/FlorianMtin)\
**Post date:** [May 30, 2017, 7:51am UTC](https://discuss.elastic.co/t/problem-to-convert-lat-and-long-for-kibana/87449/5 "2017-05-30T07:51:26Z")

</div>

Thanks a lot ! We can close the topic

---

<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:** [June 27, 2017, 7:56am UTC](https://discuss.elastic.co/t/problem-to-convert-lat-and-long-for-kibana/87449/6 "2017-06-27T07:56:07Z")

</div>

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