Last active
July 19, 2018 08:55
-
-
Save hrchu/0be91f843b9b99df0bc8 to your computer and use it in GitHub Desktop.
logstash grok filter pattern to extract (root) "Caused by:" from java stack trace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
com.xx.Exception: java.io.FileNotFoundException | |
at org.apache.cxf.jaxrs.JAXRSInvoker.handleFault(JAXRSInvoker.java:324) | |
... | |
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException | |
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:200) | |
... 46 more | |
Caused by: com.xx.WrongSizeException: blahblah | |
... 64 more |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
log4j { | |
mode => "server" | |
host => "127.0.0.1" | |
port => 9527 | |
type => "log4j" | |
} | |
} | |
filter { | |
if [type] == "log4j" { | |
grok { | |
match => [ "stack_trace", "(?!.*Caused by:)by: %{NOTSPACE:caused_by}"] | |
} | |
} | |
} | |
output { | |
#... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
com.xx.WrongSizeException |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment