用shell提取一个文件中相同的行的计数 5
我这有一段httpd_access.log日志,想要提取当中同一IP访问同一连接,每分钟小于10次就OK,大于10次就high,日志格式如下:10.238.0.161--...
我这有一段httpd_access.log日志,想要提取当中同一IP访问同一连接,每分钟小于10次就OK,大于10次就high,日志格式如下:
10.238.0.161 - - [12/Feb/2014:16:31:59 +0800] "POST /cgi-bin/online/period_reports_cy.cgi HTTP/1.1" 200 562341
10.238.144.232 - - [12/Feb/2014:16:32:20 +0800] "GET /online.html HTTP/1.1" 304 -
10.238.144.232 - - [12/Feb/2014:16:32:20 +0800] "GET /css/online.css HTTP/1.1" 304 -
10.238.144.232 - - [12/Feb/2014:16:32:20 +0800] "GET /cgi-bin/online/cp9_condition.cgi HTTP/1.1" 200 7702
10.238.144.232 - - [12/Feb/2014:16:32:20 +0800] "GET /images/bkglobe1.gif HTTP/1.1" 304 -
10.238.144.232 - - [12/Feb/2014:16:32:21 +0800] "POST /cgi-bin/online/cp9_reports.cgi HTTP/1.1" 200 142752
10.238.144.232 - - [12/Feb/2014:16:32:22 +0800] "POST /cgi-bin/online/cp9_reports.cgi HTTP/1.1" 200 148233
10.238.144.232 - - [12/Feb/2014:16:32:21 +0800] "POST /cgi-bin/online/cp9_reports.cgi HTTP/1.1" 200 419087
10.238.144.232 - - [12/Feb/2014:16:32:23 +0800] "POST /cgi-bin/online/cp9_reports.cgi HTTP/1.1" 200 437380 展开
10.238.0.161 - - [12/Feb/2014:16:31:59 +0800] "POST /cgi-bin/online/period_reports_cy.cgi HTTP/1.1" 200 562341
10.238.144.232 - - [12/Feb/2014:16:32:20 +0800] "GET /online.html HTTP/1.1" 304 -
10.238.144.232 - - [12/Feb/2014:16:32:20 +0800] "GET /css/online.css HTTP/1.1" 304 -
10.238.144.232 - - [12/Feb/2014:16:32:20 +0800] "GET /cgi-bin/online/cp9_condition.cgi HTTP/1.1" 200 7702
10.238.144.232 - - [12/Feb/2014:16:32:20 +0800] "GET /images/bkglobe1.gif HTTP/1.1" 304 -
10.238.144.232 - - [12/Feb/2014:16:32:21 +0800] "POST /cgi-bin/online/cp9_reports.cgi HTTP/1.1" 200 142752
10.238.144.232 - - [12/Feb/2014:16:32:22 +0800] "POST /cgi-bin/online/cp9_reports.cgi HTTP/1.1" 200 148233
10.238.144.232 - - [12/Feb/2014:16:32:21 +0800] "POST /cgi-bin/online/cp9_reports.cgi HTTP/1.1" 200 419087
10.238.144.232 - - [12/Feb/2014:16:32:23 +0800] "POST /cgi-bin/online/cp9_reports.cgi HTTP/1.1" 200 437380 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询