当前位置:首页 > 服务器技术 > nginx

shell分析nginx access log日志

统计访问最多的ip
1. tail -n 10000 xxaccess_log | cut -d " " -f 1 |sort|uniq -c|sort -rn|head -10 |more
2.tail -n 10000 xx-access_log | awk ‘{print $1}‘|sort|uniq -c|sort -rn|head -10 | more


统计访问最多的url
tail -n 10000 xx-access_log |awk ‘{print $7}‘| sort|uniq -c| sort -rn| head -10 | more


指定ip统计访问最多的url
tail -n 1000 xx-access_log  | grep ‘00.00.00.00’|awk ‘{print $7}‘| sort|uniq -c| sort -rn| head -10 | more
通过日志查看当天访问次数最多的时间段
tail -n 1000 xx-access_log | awk ‘{print $4}‘|cut -c 14-21 |sort|uniq -c|sort -rn|head -10|more

shell分析nginx access log日志

标签:指定   bsp   统计   nginx   print   log   时间段   nbsp   访问   

本文系统来源:http://www.cnblogs.com/xiaojinniu425/p/6261743.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!