E-mail letter to ranking statistics

As the demand for statistics about the number of the sender of the message, the following is my method:

  
  
  
  
  1. cat /var/log/maillog | egrep 'Sep  1.*Passed'| awk '{print $11,$13}' |awk -F "," '{print $1,NF}' | awk '{print $1,$3}'| sort -n |awk '{a[$1]=$1;if($1==a[$1])b[$1]=b[$1]+$2}END{for(i in b)print b[i],a[i]}' |sort -rn |more 
The results:
  
  
  
  
  1. 6413 wdradio@xxx 
  2. 4216 service@xxx 
  3. 3144 dt_job@xxx 
  4. 2647 gongqiao@xxx 
  5. 2325 dtzhaopin@xxx 
  6. 2265 mhss_tousu@xxx 
  7. 2235 wangyanan@xxx 
  8. 2233 dmx_service@xxx 
  9. 2183 dmx_tousu@xxx 
  10. 2067 chuangshi@xxx 
  11. 2000 linshaozhu@xxx 
  12. 1832 liurui@xxx 
  13. 1635 zhangqianqian@xxx 
  14. 1466 kxzd1@xxx 
  15. 1276 kxzd2@xxx 

 

你可能感兴趣的:(职场,postfix,休闲,发件统计)