Created
January 7, 2015 12:46
-
-
Save hacktvist/b8f60d4ba41a6524ff87 to your computer and use it in GitHub Desktop.
This file contains 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 { | |
if "apache_access_json" in [tags] { | |
if [useragent] != "-" and [useragent] != "" { | |
useragent { | |
add_tag => [ "UA" ] | |
source => "useragent" | |
prefix => "UA-" | |
} | |
} | |
mutate { | |
convert => ['duration', 'float'] | |
} | |
ruby { | |
code => "event['duration']/=1000000" | |
} | |
if [bytes] == 0 { mutate { remove_field => "[bytes]" } } | |
if [urlquery] == "" { mutate { remove_field => "urlquery" } } | |
if [method] =~ "(HEAD|OPTIONS)" { mutate { remove_field => "method" } } | |
if [useragent] == "-" { mutate { remove_field => "useragent" } } | |
if [referer] == "-" { mutate { remove_field => "referer" } } | |
if "UA" in [tags] { | |
if [device] == "Other" { mutate { remove_field => "device" } } | |
if [name] == "Other" { mutate { remove_field => "name" } } | |
if [os] == "Other" { mutate { remove_field => "os" } } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment