异常stacktrace的GROK模式

时间:2019-11-20 08:14:21

标签: elasticsearch logstash logback

这是我的异常堆栈跟踪

[http-nio-8080-exec-15] ERROR http-nio-8080-exec-15 SessionController error during login
java.lang.NullPointerException: null
    at com.abc.api.controller.SessionController.sessionAPI(SessionController.java:118)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

我用来解析stacktrace上方的GROK模式下方

(\[%{DATA:thread}\])? %{LOGLEVEL:level} %{USERNAME:host} %{JAVAFILE:javaClass}%{GREEDYDATA:logMessage}

下面的输出显示

{
  "thread": [
    [
      "http-nio-8080-exec-15"
    ]
  ],
  "level": [
    [
      "ERROR"
    ]
  ],
  "host": [
    [
      "http-nio-8080-exec-15"
    ]
  ],
  "javaClass": [
    [
      "SessionController"
    ]
  ],
  "logMessage": [
    [
      " error during login"
    ]
  ]
}

预期的输出应将完整的堆栈跟踪收集为logMessage。 我尝试过以下模式但没有成功

%{JAVASTACKTRACEPART:stacktrace}

0 个答案:

没有答案