1;30Nov2001;17:08:25;192.148.14.2;log;accept;;hme0;outbound;udp;192.148.84.4;24.248.34.99;domain-udp;1103;43;85;;;;;;;;;;;;;;; 2;30Nov2001;17:08:25;192.148.14.2;log;drop;;hme0;inbound;tcp;43.228.94.254;192.148.11.47;netbios-ssn;18803;48;89;;;;;;;;;;;;;;; 3;30Nov2001;17:08:26;192.148.14.2;log;drop;;hme0;inbound;tcp;45.93.220.223;192.148.24.139;auth;1323;40;89;;;;;;;;;;;;;;; 4;30Nov2001;17:08:26;192.148.14.2;log;drop;;hme0;inbound;tcp;45.93.220.223;192.148.24.139;auth;1323;40;89;;;;;;;;;;;;;;; 5;30Nov2001;17:08:26;192.148.14.2;log;accept;;qfe2;inbound;tcp;192.148.84.144;24.248.34.97;http;4719;44;85;;;;;;;;;;;;;;; 6;30Nov2001;17:08:26;192.148.14.2;log;accept;;hme0;outbound;tcp;192.148.84.144;24.248.34.97;http;4719;44;85;;;;;;;;;;;;;;; 7;30Nov2001;17:08:26;192.148.14.2;log;accept;;qfe2;inbound;tcp;192.148.84.144;24.248.34.97;http;4721;44;85;;;;;;;;;;;;;;; 8;30Nov2001;17:08:26;192.148.14.2;log;accept;;hme0;outbound;tcp;192.148.84.144;24.248.34.97;http;4721;44;85;;;;;;;;;;;;;;; 8;30Nov2001;17:08:26;192.148.14.2;log;accept;;hme0;outbound;tcp;192.148.84.144;24.248.34.97;http;4721;44;85;;;;;;;;;;;;;;; 9;30Nov2001;17:08:26;192.148.14.2;log;accept;;qfe2;inbound;tcp;192.148.27.154;205.188.145.185;http;4394;44;85;;;;;;;;;;;;;;; 10;30Nov2001;17:08:26;192.148.14.2;log;accept;;hme0;outbound;tcp;192.148.27.154;205.188.145.185;http;4394;44;85;;;;;;;;;;;;;;; 11;30Nov2001;17:08:26;192.148.14.2;log;accept;;qfe2;inbound;tcp;192.148.27.154;205.188.145.185;http;4397;44;85;;;;;;;;;;;;;;; 12;30Nov2001;17:08:26;192.148.14.2;log;accept;;hme0;outbound;tcp;192.148.27.154;205.188.145.185;http;4397;44;85;;;;;;;;;;;;;;; #### #!/usr/bin/perl -w use strict; my $log = './log'; my ($count1, $dst, $service, %count, %hash); my $ip = '24.248.36.97'; open (LOG, $log) or die "Can't open $log: $!"; while (){ ($dst, $service) = (split /;/)[11, 12]; $count1++ if ($dst =~ /$ip/); %hash = (service => $service); foreach my $key ($hash{service}){ $count{$key}++; } } foreach my $key1 (keys %count){ print "There are at least 5 occurences of $key1 and $ip.\n" if ($count{$key1} >= 5 && $count1 >= 5); } #### Use of uninitialized value in pattern match (m//) at ./misconfig.pl line 13, line 36. Use of uninitialized value in hash element at ./misconfig.pl line 17, line 36. There are at least 5 occurences of http and 24.248.36.97.