Advertisement
crhan

analyse.awk

Apr 20th, 2011
524
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Awk 0.68 KB | None | 0 0
  1. {count++;other++}
  2. $1 ~ /^10\..*/ {IP[10]++;other--}
  3. $1 ~ /^115\.200\..*/ {IP[115.200]++;other--}
  4. $1 ~ /^172\.22\..*/ {IP[172.22]+=1;other--}
  5. $1 ~ /^172\.28\..*/ {IP[172.28]+=1;other--}
  6. $1 ~ /^210\.32.200\..*/ {IP[210.32.200]+=1;other--}
  7. END { printf("总共\t%i\n",count);
  8.     printf("教学区\t%i\t%s%%\n",IP[10],IP[10]/count*100);
  9.     printf("闪讯\t%i\t%s%%\n",IP[115.200],IP[115.200]/count*100);
  10.     printf("屏峰生活区\t%i\t%s%%\n",IP[172.22],IP[172.22]/count*100);
  11.     printf("朝晖生活区\t%i\t%s%%\n",IP[172.28],IP[172.28]/count*100);
  12.     printf("服务器通讯\t%i\t%s%%\n",IP[210.32.200],IP[210.32.200]/count*100);
  13.     printf("其余外网\t%i\t%s%%\n",other,other/count*100);
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement