我正在尝试为以下类型的tcpspy日志编写GROK模式。
-Apr 21 12:08:19 ubuntu tcpspy [1243]:disconnect:user anu,local 192.168.244.128:53761,remote 216.58.210.46:https
-Apr 21 12:08:19 ubuntu tcpspy [3400]:disconnect:proc / usr / lib / firefox / firefox,user anu,local 192.168.244.128:53761, 远程216.58.210.46:https
-Apr 21 10:36:21 ubuntu tcpspy [3417]:disconnect:proc(unknown),user anu,local 192.168.244.128:40593,remote 198.105.254.11:http
这是我写的模式:
match => {"message" => "%{SYSLOGTIMESTAMP:timestamp} (?:%{SYSLOGFACILITY} )?%{SYSLOGHOST:logsource} %{SYSLOGPROG:sys}: %{WORD:wr}: %{WORD} (?:%{URIPATHPARAM:path}|[?(]%{WORD:path}[?)]), (%{WORD:word}|%{WORD:word} %{WORD:word}, %{WORD:word}) (%{IPORHOST:ip}:%{POSINT:nu}), %{WORD} (%{IPORHOST:ipp}:%{WORD:n})"}
但由于某些原因,我能够使用相同的模式解析前两种类型,但我无法解析第三种类型。