I did a fresh installation of ES and I noticed that the geo stuff didnt work by default. The old (working) mappings are as follow: (have removed few irrelevant stuff)
curl '192.168.0.11:9200/filebeat-1/_mapping?pretty'
{
"filebeat-1" : {
"mappings" : {
"apache" : {
"_all" : {
"enabled" : true,
"norms" : false
},
"dynamic_templates" : [
{
"template1" : {
"match" : "*",
"mapping" : {
"doc_values" : true,
"ignore_above" : 1024,
"index" : "not_analyzed",
"type" : "{dynamic_type}"
}
}
}
],
"geoip" : {
"dynamic" : "true",
"properties" : {
"city_name" : {
"type" : "keyword",
"ignore_above" : 1024
},
"continent_code" : {
"type" : "keyword",
"ignore_above" : 1024
},
"country_code2" : {
"type" : "keyword",
"ignore_above" : 1024
"country_name" : {
"type" : "keyword",
"ignore_above" : 1024
},
"dma_code" : {
"type" : "long"
},
"ip" : {
"type" : "keyword",
"ignore_above" : 1024
},
"latitude" : {
"type" : "float"
},
"location" : {
"type" : "geo_point"
},
"longitude" : {
"type" : "float"
},
"postal_code" : {
"type" : "keyword",
"ignore_above" : 1024
},
"region_code" : {
"type" : "keyword",
"ignore_above" : 1024
},
"region_name" : {
"type" : "keyword",
"ignore_above" : 1024
},
"timezone" : {
"type" : "keyword",
"ignore_above" : 1024
}
}
},
"geoip" : {
"dynamic" : "true",
"properties" : {
"location" : {
"type" : "geo_point"
}
}
},
"message" : {
"type" : "text"
},
"offset" : {
"type" : "long"
}
}
}
}
}
}
My fresh new ES mapping looks like:
"geoip" : { "properties" : { "city_name" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } }, "country_name" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } }, "dma_code" : { "type" : "long" }, "ip" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } }, "latitude" : { "type" : "float" }, **"location" : {** **"type" : "float"** }, "longitude" : { "type" : "float" }, "postal_code" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } },
Kibana pinpoints that the geo_point is not indexed so I assume I have to change the location type to geo_point in order to make it work ?
How I can import the old mappings to the new instance through curl or something else more convenient or how I can just change the type of that field ? I believe this should be enough to resolve the issue!