Skip to content

Instantly share code, notes, and snippets.

@zouzias
Created November 26, 2014 16:35
Show Gist options
  • Save zouzias/499b043db2775021ebbb to your computer and use it in GitHub Desktop.
Save zouzias/499b043db2775021ebbb to your computer and use it in GitHub Desktop.
Apache Tomcat Logstash Filter
# Based on http://spredzy.wordpress.com/2013/03/02/monitor-your-cluster-of-tomcat-applications-with-logstash-and-kibana/
# Changed URIPARAMS with GREEDYDATA. URIPARAMS has problem with POST (i.e., no url parameters)
filter {
grok {
type => "access-log"
pattern => "%{IP:client} \- \- \[%{DATA:datestamp}\] \"%{WORD:method} %{URIPATH:uri_path}%{GREEDYDATA:params} %{DATA:protocol}\" %{NUMBER:code} %{NUMBER:bytes}"
}
kv {
type => "access-log"
fields => ["params"]
field_split=> "&?"
}
urldecode {
type => "access-log"
all_fields => true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment