-
统计tomcat的access日志的ip次数,并按次数排序
awk ‘{sum[$1]++}END{for(i in sum) print i "\t" sum[i]}‘ localhost_access_log.* | sort -n -k2
-
统计某个接口的调用时间
awk ‘{if($7~/.*xxxxxx.*/) print $NF "\t" $7 "\t" $1 "\t" $4}‘ localhost_access_log.* | sort -n -k1
3.统计某个接口、某个IP的调用次数awk ‘{if($7~/.*getProductMatchRel.*/ && $1 =="10.30.5.195") print $NF "\t" $7 "\t" $1 "\t" $4}‘ localhost_access_log.2021-04-13.txt | wc -l