# Issue with type geo\_pont

**URL:** <https://discuss.elastic.co/t/issue-with-type-geo-pont/39585>\
**Category:** Logstash\
**Created:** [January 19, 2016, 6:55pm UTC](https://discuss.elastic.co/t/issue-with-type-geo-pont/39585 "2016-01-19T18:55:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![NiteshBarnwal](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@NiteshBarnwal](https://discuss.elastic.co/u/NiteshBarnwal)\
**Post date:** [January 19, 2016, 6:55pm UTC](https://discuss.elastic.co/t/issue-with-type-geo-pont/39585/1 "2016-01-19T18:55:39Z")

</div>

Hi, I am trying to configure multiple logs in a single conf file. Though all things are coming to kibana but geoip fields are as` string` rather than `geo_point`

While configuring separate conf file, geo\_point is there and I can see the tile map.  
My configuration is as below:

> filter {  
> mutate {  
> add\_field =\> ["hostip", "%{host}"]  
> }

> if [type] == "access" {  
> grok {  
> type =\> "access"  
> pattern =\> "%{IPORHOST:remote\_addr} - %{USERNAME:remote\_user} [%{HTTPDATE:time\_local}] "%{WORD:verb} %{URIPATH:app\_url}(?:%{URIPARAM:ap\_url\_param})? HTTP/%{NUMBER:httpversion}" %{INT:status} %{NUMBER:body\_bytes\_sent:int}"  
> }

> geoip {  
> source =\> "remote\_addr"  
> target =\> "geoip"  
> database =\>"/installdir/ELK/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-filter-geoip-1.0.2/vendor/GeoLiteCity-2013-01-18.dat"  
> add\_field =\> ["[geoip][coordinates]", "%{[geoip][longitude]}" ]  
> add\_field =\> ["[geoip][coordinates]", "%{[geoip][latitude]}" ]  
> }

> mutate {  
> convert =\> ["[geoip][coordinates]", "float" ]  
> }  
> }  
> output {  
> elasticsearch {  
> cluster =\> "elasticsearch"  
> protocol =\> "http"  
> action =\> "index"  
> host =\> "192.x.x.x"  
> index =\> "%{type}"  
> template =\> "/installdir/ELK/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-1.0.7-java/lib/logstash/outputs/elasticsearch/elasticsearch-template.json"  
> template\_name =\> "access\_temp"  
> workers =\> 1  
> }

I have also made changes to template name as:

`"template" : "access_temp"`

I also tried with if [type] clause in output. still geo\_point is not coming.

Can anyone help here

---

<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 20, 2016, 7:21am UTC](https://discuss.elastic.co/t/issue-with-type-geo-pont/39585/2 "2016-01-20T07:21:52Z")

</div>

Can you link us to the template you are using?

---

<div class="post-metadata">

**Author:** ![NiteshBarnwal](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@NiteshBarnwal](https://discuss.elastic.co/u/NiteshBarnwal)\
**Post date:** [January 20, 2016, 7:29am UTC](https://discuss.elastic.co/t/issue-with-type-geo-pont/39585/3 "2016-01-20T07:29:00Z")

</div>

```
{
  "template" : "access_temp",
  "settings" : {
    "index.refresh_interval" : "5s"
  },
  "mappings" : {
    "_default_" : {
       "_all" : {"enabled" : true, "omit_norms" : true},
       "dynamic_templates" : [ {
         "message_field" : {
           "match" : "message",
           "match_mapping_type" : "string",
           "mapping" : {
             "type" : "string", "index" : "analyzed", "omit_norms" : true
           }
         }
       }, {
         "string_fields" : {
           "match" : "*",
           "match_mapping_type" : "string",
           "mapping" : {
             "type" : "string", "index" : "analyzed", "omit_norms" : true,
               "fields" : {
                 "raw" : {"type": "string", "index" : "not_analyzed", "ignore_above" : 256}
               }
           }
         }
       } ],
       "properties" : {
         "@version": { "type": "string", "index": "not_analyzed" },
         "geoip" : {
           "type" : "object",
             "dynamic": true,
             "properties" : {
               "location" : { "type" : "geo_point",
                              "lat_lon" : true }
             }
         }
       }
    }
  }
}
```

---

<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 20, 2016, 9:13am UTC](https://discuss.elastic.co/t/issue-with-type-geo-pont/39585/4 "2016-01-20T09:13:12Z")

</div>

You're using `coordinates`, the mapping looks for `location`.

---

<div class="post-metadata">

**Author:** ![NiteshBarnwal](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@NiteshBarnwal](https://discuss.elastic.co/u/NiteshBarnwal)\
**Post date:** [January 20, 2016, 9:20am UTC](https://discuss.elastic.co/t/issue-with-type-geo-pont/39585/5 "2016-01-20T09:20:55Z")

</div>

yes I am using `lat_lon` is anything wrong there?  
I have also tried with

```
output {
    if [type] == "access" {
    elasticsearch {
       cluster => "elasticsearch"
        protocol => "http"
        action => "index"
        host => "x.x.x.x"
        index => "access"
        manage_template => true
        template_overwrite => true
        template => "/installdir/ELK/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-1.0.7-java/lib/logstash/outputs/elasticsearch/elasticsearch-template.json"
        template_name => "access"
        workers => 1
    }
    }
}

```

and template as below but no luck

```
   "properties" : {
     "@version": { "type": "string", "index": "not_analyzed" },
     "geoip" : {
       "type" : "object",
         "dynamic": true,
         "properties" : {
           "location" : { "type" : "geo_point",
                          "lat_lon" : true }
         }
     },
   "location" : { "type": "geo_point" }
   }
```

---

<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 20, 2016, 9:24am UTC](https://discuss.elastic.co/t/issue-with-type-geo-pont/39585/6 "2016-01-20T09:24:04Z")

</div>

In your LS config you use `[geoip][coordinates]`.  
In the mapping you use `geoip.location`.

These are not the same field names, the field that is created never matches the mapping. So you need to align the names so they match.

---

<div class="post-metadata">

**Author:** ![NiteshBarnwal](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@NiteshBarnwal](https://discuss.elastic.co/u/NiteshBarnwal)\
**Post date:** [January 20, 2016, 10:09am UTC](https://discuss.elastic.co/t/issue-with-type-geo-pont/39585/7 "2016-01-20T10:09:19Z")

</div>

I have used `lat_lon :true`  
How come it works when I configure one logstash.conf for one log and not for multiple logs

logstash.conf

```
output {
    elasticsearch {
       cluster => "elasticsearch"
        protocol => "http"
        action => "index"
        host => "x.x.x.x"
        index => "%{type}"
        template => "/installdir/ELK/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-1.0.7-java/lib/logstash/outputs/elasticsearch/elasticsearch-template-http.json"
        template_name => "ao_http_access"
        workers => 1
    }
     stdout {
         codec => json
     }
}

```

elasticsearch-template-http.json:

```
{
  "template" : "ao_http_access",
  "settings" : {
    "index.refresh_interval" : "5s"
  },
  "mappings" : {
    "_default_" : {
       "_all" : {"enabled" : true, "omit_norms" : true},
       "dynamic_templates" : [ {
         "message_field" : {
           "match" : "message",
           "match_mapping_type" : "string",
           "mapping" : {
             "type" : "string", "index" : "analyzed", "omit_norms" : true
           }
         }
       }, {
         "string_fields" : {
           "match" : "*",
           "match_mapping_type" : "string",
           "mapping" : {
             "type" : "string", "index" : "analyzed", "omit_norms" : true,
               "fields" : {
                 "raw" : {"type": "string", "index" : "not_analyzed", "ignore_above" : 256}
               }
           }
         }
       } ],
       "properties" : {
         "@version": { "type": "string", "index": "not_analyzed" },
         "geoip" : {
           "type" : "object",
             "dynamic": true,
             "properties" : {
               "location" : { "type" : "geo_point",
                              "lat_lon" : true }
             }
         },
       "location" : { "type": "geo_point" }
       }
    }
  }
}
```

---

<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 20, 2016, 7:30pm UTC](https://discuss.elastic.co/t/issue-with-type-geo-pont/39585/8 "2016-01-20T19:30:31Z")

</div>

I am not sure if you understand what I am saying?

---

<div class="post-metadata">

**Author:** ![NiteshBarnwal](https://avatars.discourse-cdn.com/v4/letter/n/e495f1/32.png) [@NiteshBarnwal](https://discuss.elastic.co/u/NiteshBarnwal)\
**Post date:** [January 20, 2016, 7:59pm UTC](https://discuss.elastic.co/t/issue-with-type-geo-pont/39585/9 "2016-01-20T19:59:18Z")

</div>

If I am doing correct as you are saying, I changed the location to coordinates; still same issue  
the `geoip.coordinates` is now `double`  
the output of localhost:9200/access/\_mapping?pretty=true

```
{
  "ao_access" : {
    "mappings" : {
      "ao_access" : {
        "properties" : {
          "@timestamp" : {
            "type" : "date",
            "format" : "dateOptionalTime"
          },
          "@version" : {
            "type" : "string"
          },
          "ap_url_param" : {
            "type" : "string"
          },
          "app_url" : {
            "type" : "string"
          },
          "body_bytes_sent" : {
            "type" : "long"
          },
          "file" : {
            "type" : "string"
          },
          "geoip" : {
            "properties" : {
              "area_code" : {
                "type" : "long"
              },
              "city_name" : {
                "type" : "string"
              },
              "continent_code" : {
                "type" : "string"
              },
              "coordinates" : {
                "type" : "double"
              },
              "country_code2" : {
                "type" : "string"
              },
              "country_code3" : {
                "type" : "string"
              },
              "country_name" : {
                "type" : "string"
              },
              "dma_code" : {
                "type" : "long"
              },
              "ip" : {
                "type" : "string"
              },
              "latitude" : {
                "type" : "double"
              },
              "location" : {
                "type" : "double"
              },
              "longitude" : {
                "type" : "double"
              },
              "postal_code" : {
                "type" : "string"
              },
              "real_region_name" : {
                "type" : "string"
              },
              "region_name" : {
                "type" : "string"
              },
              "timezone" : {
                "type" : "string"
              }
            }
          },
          "host" : {
            "type" : "string"
          },
          "hostip" : {
            "type" : "string"
          },
          "httpversion" : {
            "type" : "string"
          },
          "message" : {
            "type" : "string"
          },
          "offset" : {
            "type" : "string"
          },
          "remote_addr" : {
            "type" : "string"
          },
          "remote_user" : {
            "type" : "string"
          },
          "status" : {
            "type" : "string"
          },
          "tags" : {
            "type" : "string"
          },
          "time_local" : {
            "type" : "string"
          },
          "type" : {
            "type" : "string"
          },
          "verb" : {
            "type" : "string"
          }
        }
      }
    }
  }
}
```

---

<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:** [July 6, 2017, 5:15am UTC](https://discuss.elastic.co/t/issue-with-type-geo-pont/39585/10 "2017-07-06T05:15:00Z")

</div>


