Parse_AE_log.pl
Previous Page
#!/usr/local/bin/perl -n
###################################################################
# This is a quick little script to read an AE log file,
# and print out the steps that took more than a minute.
# This time may be adjusted to meet your needs by changing
# the $elapsed_seconds below. Also note that this is not
# 100% accurate,... steps that run through midnight will not
# show up.
###################################################################
$elapsed_seconds = 120;
if ( substr($_, 2, 1) eq "." )
{
$hr = substr($_, 0,2);
$min = substr($_, 3,2);
$sec = substr($_, 6,2);
$time = ($hr * 60 * 60) + ($min * 60) + $sec;
}
printf "on line %d:\n\tlast: %s\tcurr: %s Time: %d Min %d Sec\n",
$., $last_line, $_, ($time - $last_time)/60,
($time - $last_time) % 60 if $time - $last_time > $elapsed_seconds;
$last_min = $min;
$last_sec = $sec;
$last_line = $_;
$last_time = $time