我有一个input.log
文件,其中包含以下日志
web-proxy,debug userWebLogs: X-Proxy-ID: 1762099788 2017-08-11 16:34
web-proxy,debug userWebLogs: X-Forwarded-For: 100.0.3.252 2017-08-11 16:34
web-proxy,debug userWebLogs: Via: 1.1 100.0.0.1 (Mikrotik HttpProxy) 2017-08-11 16:34
web-proxy,debug userWebLogs: 2017-08-11 16:34
web-proxy,debug userWebLogs: Response to "HEAD http://tlu.dl.delivery.mp.microsoft.com/filestreamingservice/files/27512d7b-b987-49de-bd6f-c417e26ca2e3?P1=1502449265&P2=301&P3=2&P4=YY7gZVc8SsdgSjByOKsRU%2b7cRbUIZIVgXp0qiEVn%2blQ%3d": 2017-08-11 16:34
web-proxy,debug userWebLogs: HTTP/1.1 302 Hotspot login required 2017-08-11 16:34
web-proxy,debug userWebLogs: Cache-Control: no-cache 2017-08-11 16:34
web-proxy,debug userWebLogs: Content-Length: 135 2017-08-11 16:34
web-proxy,debug userWebLogs: Content-Type: text/html 2017-08-11 16:34
web-proxy,debug userWebLogs: Date: Fri, 11 Aug 2017 11:04:27 GMT 2017-08-11 16:34
web-proxy,debug userWebLogs: Expires: 0 2017-08-11 16:34
web-proxy,debug userWebLogs: Location: http://l.openwifi.in/login?dst=http%3A%2F%2Ftlu.dl.delivery.mp.microsoft.com%2Ffilestreamingservice%2Ffiles%2F27512d7b-b987-49de-bd6f-c417e26ca2e3%3FP1%3D1502449265%26P2%3D301%26P3%3D2%26P4%3DYY7gZVc8SsdgSjByOKsRU%252b7cRbUIZIVgXp0qiEVn%252bl 2017-08-11 16:34
我还有一个logstash.conf
文件,其中包含像这样的过滤器代码
input {
file {
path => "E:/logstash-5.5.1/root/input.log"
}
}
filter{
grok{
match => { "message"=> "%{WORD:word1}-%{WORD:word2},%{WORD:word3}" }
}
}
output {
stdout {}
file {
path => "E:/logstash-5.5.1/root/output.log"
codec => line{format=>"%{message}"}
}
}
我需要包含URL和IP地址的日志
我需要帮助编写过滤器match
代码。
任何帮助都将被接受。