push @lines, grep { /Running|Dump|FromCB|Update/o && filterLog($_) } <$fh>;
####
return unless ! exists $opts{'start-time'} || $opts{'start-time'} lt $1;
return unless ! exists $opts{'stop-time'} || $opts{'stop-time'} gt $1;
####
return if exists $opts{'start-time'} and $opts{'start-time'} ge $1;
return if exists $opts{'stop-time'} and $opts{'stop-time'} le $1;
####
sub mergeLogs() {
sub filterLog() {
####
sub filterLog() {
s/ {2,}/ /g;
s/^((?:\S+ ){3}).+?\[?I\]?:/$1/;
s/ ?: / /g;
s/ ACK (\w) / $1 ACK /;
return if exists $opts{'day'} and not /^$opts{'day'}/o;
return if exists $opts{'user'} and not /[\(\[]\s*(?:$opts{'user'})/o;
if (exists $opts{'start-time'} || exists $opts{'stop-time'}) {
if ($line =~ /((\d{2}):(\d{2}):(\d{2})\.(\d{3}))/o) {
return if exists $opts{'start-time'} and $opts{'start-time'} lt $1;
return if exists $opts{'stop-time'} and $opts{'stop-time'} gt $1;
}
}
warn $line if $opts{'verbose'} > 3;
return pack 'da*', ( $2*60 + $3 )*60 + "$4.$5" ), $_;
}
####
grep { /Running|Dump|FromCB|Update/o && ( $_ = filterLog($_) ) } <$fh>;
####
@lines = map{
substr $_, 8
} sort @lines;
####
s/ {2,}/ /g;
s/^((?:\S+ ){3}).+?\[?I\]?:/$1/;
s/ ?: / /g;
s/ ACK (\w) / $1 ACK /;