统计一天服务器的访问量 、pv、 uv:
awk ‘BEGIN{i=1}{i++}END{print i}‘ filename #
awk "{++state[$7]}END{for(key in state) print key,‘\t‘,state[key]}" filename #pv
awk "{++state[$1]}END{for(key in state) print key,‘\t‘,state[key]}" filename #uip
netstat -n|awk ‘/^tcp/ {++state[$NF]}END{for(key in state)print key,"\t",state[key]}‘ #查看nginx并发链接数
时间: 2024-10-09 04:38:44