输入banner图图片脚本导航/分类

统计tomcat的access日志

  1. 统计tomcat的access日志的ip次数,并按次数排序
    awk ‘{sum[$1]++}END{for(i in sum) print i "\t" sum[i]}‘ localhost_access_log.* | sort -n -k2

  2. 统计某个接口的调用时间
    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

统计tomcat的access日志

标签:oca   awk   xxxxx   xxxxxx   code   for   get   时间   cat