Skip to content

Instantly share code, notes, and snippets.

@nagetsum
Created February 3, 2020 03:19
Show Gist options
  • Select an option

  • Save nagetsum/b8dacc85802f4da0d78b429cfd240467 to your computer and use it in GitHub Desktop.

Select an option

Save nagetsum/b8dacc85802f4da0d78b429cfd240467 to your computer and use it in GitHub Desktop.
input {
stdin { }
}
filter {
grok {
match => { "message" => "%{IPORHOST:clientip} %{DATA:ident} %{DATA:auth} \[(?<timestamp>%{MONTHDAY}/%{MONTH}/%{YEAR}:%{TIME} %{DATA})\] \"%{WORD:verb} %{NOTSPACE:request} HTTP\/%{NUMBER:httpversion}\" %{NUMBER:response} (?:%{DATA:bytes}|-) %{QS:referer} %{QS:agent} %{QS:cookie} (?:\"\[%{GREEDYDATA:setcookie}\]\"|%{QS:setcookie}) %{DATA:sessionid} %{QS:threadname} %{NUMBER:durationsec}" }
}
date {
match => [ "timestamp", "dd/MMM/yyyy:HH:mm:ss Z" ]
}
mutate {
convert => {
"duration_microsec" => "integer"
}
}
}
output {
elasticsearch {}
stdout {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment