#!/usr/bin/perl # Checks for proactive hits within the past hour use File::ReadBackwards; use POSIX "strftime"; my $success; my $items; my $earliest = POSIX::strftime( "%Y-%m-%d %H:%M:%S", localtime( time() - 60 * 60 ) ); print "$earliest\n"; $bw = File::ReadBackwards->new( '/software/logs/CCASL/ccasl.log' ) or die "can't read '/software/logs/CCASL/ccasl.log' $!" ; while ( defined( my $log_line = $bw->readline() ) ) { last if $log_line lt $earliest; if ($log_line =~ /ProcessHTTPRequestImpl/) { print $log_line; } }