nginx排查连接激增IP
awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -n -k 1 -r | head -n 10
统计接口单位时间出现次数
tail -10000 /var/log/nginx/access.log | grep tcbuyer/task/getTaskHallList | awk '{print substr($4,2,20)}' | uniq -c
格式化日志输出
tail -5 access.log | awk 'FS=" " {print $4,"\t",$7}'
格式化后,获取指定接口单位时间出现次数
tail -1000 access.log | awk 'FS=" " {print $4,"\t",$7}' | grep tcbuyer/task/getTaskHallList | awk '{print substr($1,2,20)}' | uniq -c