Skip to content

Instantly share code, notes, and snippets.

@mrlesmithjr
Created October 23, 2016 20:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mrlesmithjr/2499def9f9f41ecb341f4161a4fe6d37 to your computer and use it in GitHub Desktop.
Save mrlesmithjr/2499def9f9f41ecb341f4161a4fe6d37 to your computer and use it in GitHub Desktop.
filter {
if ![source_host_ip] and "_grokparsefailure" not in [tags] {
mutate {
add_field => [ "source_host_ip", "%{host}" ]
}
dns {
resolve => [ "source_host_ip" ]
action => "replace"
}
if [source_host_ip] == "127.0.1.1" {
mutate {
update => [ "source_host_ip", "" ]
}
}
mutate {
add_field => [ "resolve_hostname", "%{source_host_ip}" ]
}
dns {
reverse => [ "resolve_hostname" ]
action => "replace"
}
mutate {
replace => [ "host", "%{resolve_hostname}" ]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment