Created
July 22, 2020 15:50
-
-
Save yaauie/2d00fe6f8ffff9ba73d1b78edb5c73f6 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]" | |
} | |
remove_field => "[@metadata][host_geoip]" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The AS information are missing.