Skip to content

Instantly share code, notes, and snippets.

@Kuermel
Kuermel / ecs-complaint-host-geoip.conf
Last active August 20, 2020 13:41 — forked from yaauie/ecs-complaint-host-geoip.conf
Example remapping the fields output by GeoIP filter for a host ip to ECS's host geo fields, as identified in the ECS compatibility mode issue https://github.com/logstash-plugins/logstash-filter-geoip/issues/163#issuecomment-592177677
filter {
geoip {
source => "[host][ip]"
target => "[@metadata][host_geoip]"
}
if [@metadata][host_geoip] {
mutate {
copy => {
"[@metadata][host_geoip][city_name]" => "[host][geo][city_name]"
"[@metadata][host_geoip][country_name]" => "[host][geo][country_name]"