I am not sure what is wrong with my output. It is the output that I want.
From here, source 192.168.6.0 has 2 unique destination (88.0.33.22 and 111.22.35.0). and total of the flows is 12 (12+1+2) and total bytes 660 (128+168+364). So. from your code, I am trying to fit with my code. I am using awk -f count.awk. This are the lines in the count.awk file.
{src[$1,$2]++
total[$1,$2]=total[$1,$2]+$3
bytes[$1,$2]=bytes[$1,$2]+$4
}
END{
for (i in src) print src " " src "\t" total "\t" bytes
}
However, I got an error said that the src array is an illegal reference. Please help me. Need to solve this problem
Many thanks for your help. I am now manage to produce the output I want. However, when I manually check, there is line of output is miscalculate. When I try remove the NR>1 then it works perfectly.