shell分析nginx日志的一些指令
阿里云国内75折 回扣 微信号:monov8 |
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6 |
前言
nginx日志格式默认
shell指令
awk '{print $1}' log_file|sort|uniq|wc -l
grep "/index.php" log_file | wc -l
awk '{++S[$1]} END {for (a in S) print a,S[a]}' log_file > log.txt
# 配合sort进一步排序
sort -n -t ' ' -k 2 log.txt
awk '{++S[$1]} END {for (a in S) print S[a],a}' log_file | sort -n
grep ^111.111.111.111 log_file| awk '{print $1,$7}'
- 查看2015年8月16日14时这一个小时内有多少IP访问:
awk '{print $4,$1}' log_file | grep 16/Aug/2015:14 | awk '{print $2}'| sort | uniq | wc -l
awk '{print $1}' |sort|uniq -c|sort -nr |head -10 access_log
cat log_file|awk '{print $11}'|sort|uniq -c|sort -nr | head -10
cat log_file|awk '{print $11}'|sort|uniq -c|sort -nr|head -20
awk '{print $1}' log_file |sort -n -r |uniq -c | sort -n -r | head -20
阿里云国内75折 回扣 微信号:monov8 |
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6 |