#!/usr/bin/awk -f
# lap : 1--overlap 0--non-overlap
# comp: 1--access  0--origin
# pos : 4 | 10 | 11
BEGIN {
    number=0
    if(code!="" && comp==1) { sc=4 }    
    if(code!="" && comp==0) { sc=11 }    
    if(code=="") { sc=1000 }    
    if(comp==1) { ac=56 }    
    if(comp==0) { ac=50 }    
}

{
    if(acc==$ac && code==$sc)
        number++
}

END {
    if(code != "")
        # 如果百分比不是100%说明这个节点有重叠域名访问日志
        printf "%-8s%-15s%-s\n", code, number, number/NR*100"%"
    else
        printf "%-8s%-15s%-s\n", "QPS", number, number/NR*100"%"
}


