一,解析日志得到访问量最高的100个ip地址:
awk '{print $1}' www.access_log | sort | uniq -c | sort -n -k 1 -r | head -n 100
效果如图:
二,解析日志得到访问量最高的10个url
命令
[root@blog 27]# awk '{print $7}' 20240827_access.log|sort|uniq -c|sort -rn|head -10
返回例子:
2404 /323 /favicon.ico284 400101 /user/upload88 \x84\xB4,\x85\xAFn\xE3Y\xBBbhl\xFF(=':\xA9\x82\xD9o\xC8\xA2\xD7\x93\x98\xB4\xEF\x80\xE5\xB9\x90\x00(\xC0"70 /.env49 /robots.txt47 /wp/wp-includes/wlwmanifest.xml47 /wp1/wp-includes/wlwmanifest.xml47 /wordpress/wp-includes/wlwmanifest.xml