Many Thanks for immediate replies. Sorry I forgot to mention that there are lines in the log file beginning with Starting which need to considered but there are also lines beginning with Starting stop module name - which are not to be considered, Please suggest how to get rid of these lines in the array @linetypes mentioned in the solution provided? I am trying like this, Kindly suggest:
use strict; use warnings; my @starting=(); my @success=(); my @linetypes = ("Starting", "SUCCESS: Completed"); my $linetypes_re = join("|", @linetypes); open (LG, "path of the os.log"); @log=<LG>; for my $line (@log) { chomp $line; next unless $line; my ($linetype, $moudle, $year, $month, $day, $hh, $mm) = $line =~ +m/^($linetypes_re) (.+$) at (\d{4})-(\d{2})-(\d{2})-(\d{2})(\d{2})\.$ +/ my $info = [$module, $year, $month, $day, $hh, $mm]; if ($linetype eq $linetypes[0]) { push @starting, $info; } elsif ($linetype eq $linetypes[1]) { push @succes, $info; } }
In reply to Re^2: search and give the time difference
by raghvens
in thread search and give the time difference
by raghvens
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |