- #author souroot
- #email: souroot@163.com
- #we use formular: (all the send packets in agents layer)
- #-(all the recieve packets in agents layer) as all the lost packets
- BEGIN{
- send;
- recv;
- }
- {
- if(($1)=="s" && ($4)=="AGT")
- send++;
- if(($1)=="r" && ($4)=="AGT")
- recv++;
- }
- END{
- printf "send is %d, recv is %d\n",send,recv;
- printf "drop rate is %4f\n",(send-recv)/send;
- }
注意:$1代表第一列,$4代表第四列。BEGIN表示循环开始,END表示循环结束