Hello, I have been just banging my head on the keyboard trying to figure out why all fields are created in my event but the ".location" field
I understand that with the correct index mapping: - like so?
{
"template": [ "logstash-", "kafka-", "filebeat-" ],
"order": 0,
"version": 60002,
"index_patterns": [ "" ],
"settings": {
"index": {
"refresh_interval": "30s"
}
},
"mappings" : {
"doc" : {
"dynamic_templates" : [ {
"message_field" : {
"path_match" : "message",
"match_mapping_type" : "string",
"mapping" : {
"type" : "text",
"norms" : false
}
}
}, {
"string_fields" : {
"match" : "*",
"match_mapping_type" : "string",
"mapping" : {
"type" : "text", "norms" : false,
"fields" : {
"keyword" : { "type": "keyword", "ignore_above": 256 }
}
}
}
} ],
"properties" : {
"@timestamp": { "type": "date"},
"@version": { "type": "keyword"},
"source_geo" : {
"dynamic": true,
"properties" : {
"ip": { "type": "ip" },
"location" : { "type" : "geo_point" },
"latitude" : { "type" : "half_float" },
"longitude" : { "type" : "half_float" },
"lat" : { "type" : "half_float" },
"lon" : { "type" : "half_float" }
}
},
"destination_geo" : {
"dynamic": true,
"properties" : {
"ip": { "type": "ip" },
"location" : { "type" : "geo_point" },
"latitude" : { "type" : "half_float" },
"longitude" : { "type" : "half_float" },
"lat" : { "type" : "half_float" },
"lon" : { "type" : "half_float" }
}
}
}
}
}
}
...and part of my logstash config:
geoip {
source => "[destination_ip]"
target => "destination_geo"
fields => ["city_name", "continent_code", "country_code2", "country_name", "region_name", "location", "latitude", "longitude"]
#add_field => { "destination_geo.location" => [ "%{destination_geo.lat}", "%{destination_geo.lon}" ] }
}
Results... Still I only get events that contain all the geo fields specified to display but the ".location" , hence I can not create a tile map... ( I don't understand why there is a .location.lat and .location.lon )
*Additionally, if I un-comment the unneeded "add-field" line - I am met with logstash errors like this: (so I know its not right):
... argument_exception", "reason"=>"illegal latitude value [269.99999983236194] for source_geo.location"}}}}
Could anyone help?!?!?
Yes - when I do look at the specific index mapping the fields are correctly mapped on the live index...
(partial output)
"destination_geo": {
"dynamic": "true",
"properties": {
"city_name": {
"type": "text",
"norms": false,
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"continent_code": {
"type": "text",
"norms": false,
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"country_code2": {
"type": "text",
"norms": false,
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"country_name": {
"type": "text",
"norms": false,
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"ip": {
"type": "ip"
},
"latitude": {
"type": "half_float"
},
"location": {
"type": "geo_point"
},
"longitude": {
"type": "half_float"
},
"region_name": {
"type": "text",
"norms": false,
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
To note: I am simply updating the "logstash" mapping at the dev console with a "PUT". Not useing a special mapping template name and not specifying anything in the Logstash- elasticsearch output plugin params.
Thanks!