#!/eng/local/bin/perl %hash; $hash{'200'}="OK "; $hash{'201'}="Created "; $hash{'202'}="Accepted "; $hash{'203'}="Non-Authoritative Information "; $hash{'204'}="No Content "; $hash{'205'}="Reset Content "; $hash{'206'}="Partial Content "; $hash{'300'}="Multiple Choices "; $hash{'301'}="Moved Permanently "; $hash{'302'}="Moved Temporarily "; $hash{'303'}="See Other "; $hash{'304'}="Not Modified "; $hash{'305'}="Use Proxy "; $hash{'400'}="Bad Request "; $hash{'401'}="Unauthorized "; $hash{'402'}="Payment Required "; $hash{'403'}="Forbidden "; $hash{'404'}="Not Found "; $hash{'405'}="Method Not Allowed "; $hash{'406'}="Not Acceptable "; $hash{'407'}="Proxy Authentication Required "; $hash{'408'}="Request Timeout "; $hash{'409'}="Conflict "; $hash{'410'}="Gone "; $hash{'411'}="Length Required "; $hash{'412'}="Precondition Failed "; $hash{'413'}="Request Entity Too Large "; $hash{'414'}="Request URI Too Large "; $hash{'415'}="Unsupported Media Type "; $hash{'500'}="Internal Server Error "; $hash{'501'}="Not Implemented "; $hash{'502'}="Bad Gateway "; $hash{'503'}="Service Unavailable "; $hash{'504'}="Gateway Timeout "; $hash{'505'}="HTTP Version Not Supported "; $hash{'600'}="Squid header parsing error "; my %hash2; open (FILE, "$ARGV[0]"); foreach (){ chop; @array= split(/\"/,$_); #@array= split(/\"[^\"]*\"/,$_); # foreach $duh (@array){ # print "-> $duh\n"; # } # foreach $er (@array){ $er =~ s/GET //g; $er =~ s/ HTTP\/1.0//g; $er =~ s/ HTTP\/1.1//g; chomp $er; } (undef, undef, undef, undef, $caller) = split (/ /, $array[0]); (undef, $status, undef) = split (/ /, $array[2]); @what = split (/\//, $array[3]); if ($status == "404"){ if ($what[2] eq "www.eng.utoledo.edu"){ $from= $array[3]; $from=~ s/http:\/\///; $from=~ s/(131.183.8.5|127.0.0.1|green.eng.utoledo.edu|www.eng.utoledo.edu)//; $hash2{$from}{$array[1]}++; #print "what $caller is getting -> $array[1]"; #print "status -> $hash{$status}"; #print "from -> $array[3]"; #print "notify -> $who"; #print "\n"; } else{ } } } foreach $key (sort {$a cmp $b} (keys %hash2)){ foreach $value (keys %{$hash2{$key}}){ print "$key ->$value \n"; } } #foreach $key ( keys %hash2){ # my @erp=split (/\n/,"$hash2{$key}"); # @rt=sort {$a cmp $b} (@erp); # print "$key ->\n"; # my %hash3; # foreach $qwe (@rt){ # $hash3{"$qwe"}="$qwe"; # } # foreach $asd( keys %hash3){ # print "$hash3{$asd}\n"; # } # print "\n"; #} close(FILE);