产品动态
公告
10.20.20.10 ::: [Tue Jan 22 14:49:45 CST 2019 +0800] ::: GET /online/sample HTTP/1.1 ::: 127.0.0.1 ::: 200 ::: 647 ::: 35 ::: http://127.0.0.1/
:::切分为八个字段,并为每个字段定义名称:IP: 10.20.20.10bytes: 35host: 127.0.0.1length: 647referer: http://127.0.0.1/request: GET /online/sample HTTP/1.1status: 200time: [Tue Jan 22 14:49:45 CST 2019 +0800]
10.20.20.10 ::: [Tue Jan 22 14:49:45 CST 2019 +0800] ::: GET /online/sample HTTP/1.1 ::: 127.0.0.1 ::: 200 ::: 647 ::: 35 ::: http://127.0.0.1/
IP: 10.20.20.10bytes: 35host: 127.0.0.1length: 647referer: http://127.0.0.1/request: GET /online/sample HTTP/1.1status: 200time: [Tue Jan 22 14:49:45 CST 2019 +0800]
# grep "/online/sample" test.log
request:"/online/sample"
# grep -v "200" test.log
NOT status:200
status:>=500
# grep -c -v "200" test.log
NOT status:200 | select count(*) as errorLogCounts
# grep "200" test.log | grep "/online/sample"
status:200 AND request:"/online/sample"
# grep -E "/online/sample|/offline/sample" test.log
request:"/online/sample" OR request:"/offline/sample"
# grep -rn "/online/sample" --exclude=test.log
request:"/online/sample" AND NOT __FILENAME__:"test.log"
# grep "[Tue Jan 22 14:49:45 CST 2019 +0800]" -B 10 test.log
time:"[Tue Jan 22 14:49:45 CST 2019 +0800]"
文档反馈