我正在尝试使用 onigurama 正则表达式库(在 Logstash 中)使用负面的后视来捕获日志文件中的一行,但它似乎仍然与它不应该匹配的行匹配。我试图只匹配顶级异常,而不是以Caused By 开头的异常:
有人帮我写了这个
在 Rubular http://rubular.com/r/N3AzySNHiS上测试
测试正则表达式
^(?<!Caused by: ).*?Exception
(?<!^Caused by: ).*?Exception
信息:
2016-11-15 05:19:28,801 ERROR [App-Initialisation-Thread] appengine.java:520 Failed to initialize external authenticator myapp Support Access || appuser@vm23-13:/mnt/data/install/assembly app-1.4.12@cad85b224cce11eb5defa126030f21fa867b0dad
java.lang.IllegalArgumentException: Could not check if provided root is a directory
at com.myapp.jsp.KewServeInitContextListener$1.run(QServerInitContextListener.java:104)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.nio.file.NoSuchFileException: fh-ldap-config/
at com.upplication.s3fs.util.S3Utils.getS3ObjectSummary(S3Utils.java:55)
at com.upplication.s3fs.util.S3Utils.getS3FileAttributes(S3Utils.java:64)
Logstash 结果
"exception" => "Caused by: java.nio.file.NoSuchFileException"