#!/usr/bin/perl # 01/21-00:05:26.163026 [**] [1:2189:1] # BAD-TRAFFIC IP Proto 103 (PIM) [**] # [Classification: Detection of a non-standard protocol or event] [Priority: 2] {PROTO103} 128.208.131.100 -> 224.0.0.13 while (<>) { @a=split(' \[\*\*\] '); $a[1] =~ s/\[[0-9:]+\] //; ++$count{"$a[1]"}; } open(O, "|sort") || die "can't open pipe to sort: $!\n"; foreach $i (sort keys %count) { printf(O "%9d %s\n", $count{$i}, $i); } close(O); exit(0);