1
我正在測試grok debugger,但我無法得到它來解決我的問題。grok調試器正則表達式使用
示例文本:
2014-06-17 04:37:30,317 c.e.A.MyActivity INFO main MyActivity.java 53 com.example.ApLogback.MyActivity$1 onClick logger track
我應該如何構建一個神交正則表達式/模式字符串,使其分裂之前的示例文本如以下部分組成:
{
timestamp:2014-06-17 04:37:30,317
logger:c.e.A.MyActivity
level:info
caller_thread:main
caller_method:MyActivity.java
caller_line:53
caller_class:com.example.ApLogback.MyActivity$1
caller_method: onClick
msg: caller track
}
我當前正則表達式爲:
(?<timestamp>[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2},[0-9]{3}) (?<logger>.*)
但它僅分割部分日誌字符串的開頭。我目前的神交字符串的示例結果是:
{
"timestamp": [
[
"2014-06-17 04:37:30,317"
]
],
"logger": [
[
"c.e.A.MyActivity INFO main MyActivity.java 53 com.example.ApLogback.MyActivity$1 onClick logger"
]
]
}