I have an awk line of:
awk '{if ($6 == "allow") print $1,$2,$3,$13,$15,$14,$6,$17,$18,$19,$20,$21}' firebox
$3=protocol, $17=ip address target
I would like to be able to get awk produce a report that would group on field #3, giving me a count of how many times it appeared in firebox for each ip address.
For instance:
smtp 10.10.10.10 5 times
smtp 10.10.10.30 9 times
ssh 10.10.10.50 1 times
Is this do-able with awk?
awk '{if ($6 == "allow") print $1,$2,$3,$13,$15,$14,$6,$17,$18,$19,$20,$21}' firebox
$3=protocol, $17=ip address target
I would like to be able to get awk produce a report that would group on field #3, giving me a count of how many times it appeared in firebox for each ip address.
For instance:
smtp 10.10.10.10 5 times
smtp 10.10.10.30 9 times
ssh 10.10.10.50 1 times
Is this do-able with awk?