Skip to content

Instantly share code, notes, and snippets.

@hyleung
Last active August 29, 2015 14:13
Show Gist options
  • Save hyleung/f693f76744d2fe922373 to your computer and use it in GitHub Desktop.
Save hyleung/f693f76744d2fe922373 to your computer and use it in GitHub Desktop.
Logstash conf for java stacktraces
input {
file {
type => "tomcat"
path => ["/var/logs/*"]
codec => multiline {
pattern => "(^.+Exception: .+)|(^\s+at .+)|(^\s+... \d+ more)|(^\s*Caused by:.+)|(^\s+...\s[\d]+[\s\w]+$)"
what => "previous"
}
}
}
filter {
if [type] == "tomcat" and "multiline" in [tags] {
grok {
match => ["message", "%{JAVASTACKTRACEPART}"]
}
}
}
output {
stdout {
codec => rubydebug
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment