渡人自渡 发表于 2018-11-27 10:15:05

awk 分析apache日志

总流量
awk -F '"' '{print $3}' /opt/lampp/logs/access_log | awk '{sum+=$2};END {print sum}'
访问次数前十的ip
awk '{++S[$1]} END {for(a in S) print a,S}' /opt/lampp/logs/access_log | sort -k2 -n -r | head
访问次数前十的连接
awk-F '"''{print $2}' /opt/lampp/logs/access_log | sort | uniq -c | sort -k1 -n -r | head -20



页: [1]
查看完整版本: awk 分析apache日志