Geoip issues with ES 2.3.1

Cluster ID: fb793b

Continuing the discussion from Update mapping for geoip.location:

I am also having an issue similar to this.
I am using the Sense app within Kibana to test some of these things out but ultimately it will be apart of a batch file using curl.

   "error": {
      "root_cause": [
         {
            "type": "mapper_parsing_exception",
            "reason": "Root mapping definition has unsupported parameters:  [geoip : {type=object, properties={coordinates={type=geo_point}}}]"
         }
      ],
      "type": "mapper_parsing_exception",
      "reason": "Root mapping definition has unsupported parameters:  [geoip : {type=object, properties={coordinates={type=geo_point}}}]"
   },
   "status": 400
}```
That is the error I receive after creating a new index and then running this mapping against it
```POST myindex/mylogs/_mapping
{
  "geoip": {
          "type": "object",
          "properties": { 
            "coordinates": {
              "type": "geo_point"
          }
        }
      }
}```

I should not I tried this with another block of information because previously my geoip was able to give me much more information and then mapping worked fine. But in an attempt to figure out the problem I stripped everything out but the coordinates.

Also sorry about formatting, I don't know how to get pretty code formatting

EDIT:
`{
  "properties": {
    "InstanceName": {
            "type": "string",
            "fields": {
              "raw":   { "type": "string", "index": "not_analyzed" }
            }
        }
  }
`
This works with the POST url 
but however when I add in 
`
"geoip": {
          "type": "object",
          "fields": {
            "city_name": {
              "type": "string"
            },
            "continent_code": {
              "type": "string"
            },
            "coordinates": {
              "type": "geo_point"
            },
            "country_code2": {
              "type": "string"
            },
            "country_code3": {
              "type": "string"
            },
            "country_name": {
              "type": "string"
            },
            "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"
            }`
Then it fails and isn't happy.

Alright so I've done some investigation into this and have resolved my issues.
{
"properties": {
"InstanceName": {
"type": "string",
"fields": {
"raw": { "type": "string", "index": "not_analyzed" }
}
},
"geoip": {
"type": "object",
"dynamic": "true",
"properties": {
"coordinates": { "type": "geo_point", "index": "not_analyzed"},
"country_code2": { "type": "string" },
"country_code3": { "type": "string" },
"country_name": { "type": "string" },
"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" }
}
}
}
}
This makes both my bat file and sense happy and i get that all so glorious {acknowledged: true}. The things I was missing are located in bold (or they were supposed to be......)

1 Like