lol...... I had a typo in the syntax I was using.......
Ok here is what's happening...
script:
#!/usr/bin/perl -w
#
$ARGV[0] = 'url2.log';
my %status;
while (<>) {
/ (FAILED|SUCCESS) (.*)/ and $status{$2} = $1;
}
print "URLs whose last status was SUCCESS:\n";
$status{$_} eq 'SUCCESS' and print " $_\n" for sort keys %status;
print "\nURLs whose last status was FAILED:\n";
$status{$_} eq 'FAILED' and print " $_\n" for sort keys %status;
Log File:
root@digger > more url2.log
[2005-01-04 09:17:59] FAILURE RESPONSE: Exceeded retry count (1) from
http://192.168.6.7:2888/
[2005-01-04 09:17:59] FAILURE RESPONSE: Exceeded retry count (1) from
http://192.9.6.7:2888/
[2005-01-04 09:18:57] SUCCESS RESPONSE from
http://192.168.6.7:2888/
[2005-01-04 09:26:57] FAILURE RESPONSE from
http://192.55.6.7:2888/
Output:
root@digger > ./test2.pl
URLs whose last status was SUCCESS:
RESPONSE from
http://192.168.6.7:2888/
URLs whose last status was FAILED:
As we can see it did pick up the first URL that initially FAILED then
a few minutes later had a SUCCESS. But it didn't pickup
http://192.9.6.7:2888/
http://192.55.6.7:2888/
that both had a FAILURE status, which is what I am concerned
about.....