1,统计PV和IP

统计当天的PV(Page View)

cat access.log | sed -n /`date "+%d\/%b\/%Y"`/p |wc -l

统计某一天的PV

cat access.log | sed -n '/20\/Sep\/2018/p' | wc -l

查看日志中访问次数最多的前10个IP

cat access.log.1 |cut -d ' ' -f 1 | sort |uniq -c | sort -nr | awk '{print $0 }' | head -n 10

查看日志中访问次数超过1000次的前10个IP

cat access.log.1 |cut -d ' ' -f 1 | sort |uniq -c | sort -nr | awk '{if($1>1000) print $0 }' | head -n 10

2,curl发送数据

使用curl发送GET请求

curl http://127.0.0.1:8080/login?admin&passwd=12345678

 1/4   上一页 1 2 3 4 下一页 尾页

文章TAG:shell定时统计  shell  nginx  access.log