Skip to content

Instantly share code, notes, and snippets.

@colinsurprenant
Created April 25, 2014 16:30
Show Gist options
  • Save colinsurprenant/11295393 to your computer and use it in GitHub Desktop.
Save colinsurprenant/11295393 to your computer and use it in GitHub Desktop.
logstash examples
input { stdin {} }
filter {}
output {
stdout {
codec => rubydebug
}
}
filter {
grok {
match => {
"message" => '%{HTTPDATE:timestamp} %{IP:ip} <%{DATA:msg}>'
}
}
}
18/Mar/2014:18:31:15 -0500 8.8.8.8 <hello world>
date {
match => [ "timestamp", "dd/MMM/YYYY:HH:mm:ss Z" ]
}
date {
match => [ "timestamp", "dd/MMM/YYYY:HH:mm:ss Z" ]
}
geoip {
source => "ip"
}
%{IPORHOST:clientip} %{USER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] "%{WORD:verb} %{DATA:request} HTTP/%{NUMBER:httpversion}" %{NUMBER:response:int} (?:-|%{NUMBER:bytes:int}) %{QS:referrer} %{QS:agent}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment