Created
July 2, 2017 16:48
-
-
Save ntakouris/8a97418b7130b6e4406e60817789ae66 to your computer and use it in GitHub Desktop.
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
input { | |
beats{ | |
port => 5044 | |
} | |
} | |
filter{ | |
if[message] =~ "^#" { drop{} } | |
if[server] == "alkistis"{ | |
grok{ | |
match => ["message", "%{TIMESTAMP_ISO8601:log_timestamp} %{WORD:iisSite} %{IPORHOST:site} %{WORD:method} %{URIPATH:page} %{NOTSPACE:querystring} %{NUMBER:port} %{NOTSPACE:username} %{IPORHOST:clienthost} %{NOTSPACE:useragent} %{NOTSPACE:referer} %{NUMBER:response} %{NUMBER:subresponse} %{NUMBER:scstatus} %{NUMBER:bytes:int} %{NUMBER:timetaken:int}"] | |
} | |
mutate { | |
add_field => { | |
"index_type" => "alkistis" | |
"doctype" => "iis-log" | |
} | |
} | |
}else{ | |
mutate{ | |
add_field => { | |
"index_type" => "%{[@metadata][beat]}" | |
"doctype" => "%{[@metadata][type]}" | |
} | |
} | |
} | |
} | |
output { | |
stdout { codec => rubydebug } | |
elasticsearch { | |
user => "user" | |
password => "password" | |
hosts => ["localhost:9200"] | |
manage_template => false | |
index => "%{index_type}-%{+YYYY.MM.dd}" | |
document_type => "%{doctype}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment