access_log /data/logs/nginx-access.log;log_format old '$remote_addr [$time_local] $status $request_time $body_bytes_sent ''"$request" "$http_referer" "$http_user_agent"';
access_log /data/logs/nginx-access.log buffer=32k flush=5s;
log_format new '$remote_addr^A$http_x_forwarded_for^A$host^A$time_local^A$status^A''$request_time^A$request_length^A$bytes_sent^A$http_referer^A$request^A$http_user_agent';
cat access.log | awk -F ‘^A’ ‘{print $10}’ | sort | uniq -c
cat access.log | awk -F ‘^A’ ‘{if($5 == 500) print $0}’
cat access.log | awk -F ‘^A’ ‘{if($5 == 500) print $0}’ | wc -l
cat access.log | awk -F ‘^A’ ‘{if($5 == 500) print $0}’ | grep ’09:00’ | wc-l
tail -f access.log | awk -F ‘^A’ ‘{if($6>1) print $0}’
tail -f access.log | awk -F ‘^A’ ‘{if($6>1) print $3″|”$4}’
cat access.log | awk -F ‘^A’ ‘{if($5==502) print $11}’ | sort | uniq -c
cat access.log | awk -F ‘^A’ ‘{if($5==200 && $8
tail -f access.log | cat -e
或者
tail -f access.log | tr ‘^A’ ‘|’
以上就介绍了纯手工玩转 Nginx 日志,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
已抢65566个
抢已抢30227个
抢已抢16621个
抢已抢8440个
抢已抢10922个
抢已抢22275个
抢