【发布时间】:2026-02-07 09:35:01
【问题描述】:
我的日志看起来像这样(IIS 完整日志)
2015-03-12 16:46:33 W3SVC1 TESTPC 192.168.50.4 GET / - 443 - 217.20.181.177 HTTP/1.1 Mozilla/5.0+(Windows+NT+6.3;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/40.0.2214.115+Safari/537.36 - - hideme.ru 200 0 0 1449 402 187
我的 httpversion 格式有问题(看起来像 HTTP/1.1)。我不知道如何格式化它
我只是通过使用 grok 模式页面来使用以下格式。
%{TIMESTAMP_ISO8601:timestamp} %{WORD:sitename} %{NOTSPACE:whost} %{IPORHOST:hostip} %{WORD:method} %{URIPATH:page} %{NOTSPACE:query} %{NUMBER:port} %{NOTSPACE:username} %{IPORHOST:clientip} %{GREEDYDATA:httpversion} %{NOTSPACE:useragent} %{NOTSPACE:cookie} %{NOTSPACE:referrer} %{WORD:host} %{NUMBER:status} %{NUMBER:substatus} %{NUMBER:scstatus} %{NUMBER:csbytes} %{NUMBER:timetaken}
【问题讨论】: