Forked from yaauie/ecs-complaint-host-geoip.conf
Last active
August 20, 2020 13:41
-
-
Save Kuermel/5874e9e5a7e70b7c645659b5ed98f8b7 to your computer and use it in GitHub Desktop.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]" | |
"[@metadata][host_geoip][continent_name]" => "[host][geo][continent_name]" | |
"[@metadata][host_geoip][country_code2]" => "[host][geo][country_iso_code]" | |
"[@metadata][host_geoip][region_name]" => "[host][geo][region_name]" | |
"[@metadata][host_geoip][region_code]" => "[host][geo][region_iso_code]" | |
"[@metadata][host_geoip][latitude]" => "[host][geo][location][lat]" | |
"[@metadata][host_geoip][longitude]" => "[host][geo][location][lon]" | |
"[@metadata][host_geoip][as_org]" => "[host][as][organization][name]" | |
"[@metadata][host_geoip][asn]" => "[host][as][number]" | |
} | |
remove_field => "[@metadata][host_geoip]" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment