Skip to content

Instantly share code, notes, and snippets.

@itomg
Created October 29, 2013 03:37
Show Gist options
  • Save itomg/7208846 to your computer and use it in GitHub Desktop.
Save itomg/7208846 to your computer and use it in GitHub Desktop.
#分析日志中的UserAgent
cat access_20130704.log | awk -F "\"" '{print $(NF-3)}' | sort | uniq -c | sort -nr | head -20
#上面的脚本将分析出日志文件中最多的20个UserAgent
#分析日志中那些IP访问最多
cat access_20130704.log | awk '{print $1}' | sort | uniq -c | sort -nr | head -20
#分析日志中那些Url请求访问次数最多
cat access_20130704.log | awk -F "\"" '{print $(NF-5)}' | sort | uniq -c | sort -nr | head -20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment