vasuperl has asked for the wisdom of the Perl Monks concerning the following question:
rrcConnectionRelease{ attach request measurementReport{ Event A1 Id 13 Purpose . . . . . . .so on lines
I had tried this code, its working. But i need a generic way where in i can grep for more than three log patterns. Is it possible to grep these patterns by storing into an array variable? Any help would be appreciated. Thanks in advancemy $logpattern1=rrcConnection; my $logpattern2=measurementReport; my $logpattern3=Event; open(LOGFILE,"$filepath"); my @file=<FILE>; my $f=join("",@file); if ($f=~/.*$logpattern1.*?$logpattern2.*?$logpattern3/gs){ &statuslog("Found log marker : $logpattern1 $logpattern2 $logpattern3 + in TM500log\n"); } else{ &errorlog("Failed to find log marker: $logpattern2 $logpattern3 in $lo +gpattern1 in TM500log\n"); } close(LOGFILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Generic multiline grepping
by Happy-the-monk (Canon) on Mar 05, 2015 at 08:11 UTC | |
|
Re: Generic multiline grepping
by vinoth.ree (Monsignor) on Mar 05, 2015 at 07:34 UTC | |
by vasuperl (Acolyte) on Mar 06, 2015 at 05:45 UTC | |
by vasuperl (Acolyte) on Mar 06, 2015 at 05:09 UTC | |
|
Re: Generic multiline grepping
by hdb (Monsignor) on Mar 05, 2015 at 09:05 UTC |