Nginx配置说明

实时QPS:
tail -f /home/wwwlogs/access.log | awk -F '[' '{print $2}' | awk 'BEGIN{key="";count=0}{if(key==$1){count++}else{printf("%s\t%d\r\n", key, count);count=1;key=$1}}'

统计qps:
cat /home/wwwlogs/access.log | awk '{print $4}'|uniq -c|sort -n

统计非200|前5
awk '{if ($11 != 200){print $11}}' /home/wwwlogs/access.log|sort|uniq -c|sort -rn|head -5

统计次数最多的十个IP:
awk '{print $1}' /home/wwwlogs/access.log | sort | uniq -c | sort -nr | head -n 10

posted @ 2022-10-10 03:06  笑笑ai  阅读(17)  评论(0)    收藏  举报