工作中用到的统计命令:
1,统计秒杀
awk -F "," '!a[$2,$3,$6,$7,$9]++' pushLog.log.2015-04-22 |grep "*ms" |awk -F "," '{a[$2" "$3" "$9]+=1}END{for(i in a) printf "%s %s\n",i,a[i]}'
2,秒杀统计sql:
select count(distinct(cookie)) from logs_mobile_stat
where time>'2015-04-22 23:59:59' and p1='p*t' and p2='*ms'
and platform=1
3,awk -F "," '!a[$2,$3,$6,$7,$9]++' pushLog.log.2015-04-25 |grep "http://m.taofen8.com/activity/today/brand0425/" |awk -F "," '{a[$2" "$3" "$9]+=1}END{for(i in a) printf "%s %s\n",i,a[i]}' | sort -k 4 -n -r | head -n 15
结果例如:
lp*t *wl 3 12832
p*t *wl 3 8403
p*t *wl 1 3946