Skip to content

Instantly share code, notes, and snippets.

@ntakouris
Created July 2, 2017 16:48
Show Gist options
  • Save ntakouris/8a97418b7130b6e4406e60817789ae66 to your computer and use it in GitHub Desktop.
Save ntakouris/8a97418b7130b6e4406e60817789ae66 to your computer and use it in GitHub Desktop.
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