Something bad happened with orchestral stuff at com.orchestral.rhapsody.execution.route.spi.conditions.ConnectorExecutor.accepts(ConnectorExecutor.java:4) and I don't know what to do about this execution failure but execution of orchestral stuff is important #### #!/usr/bin/perl use strict; use warnings; # Create test data, change logic a smidge if reading from monster log file my @LogBuffer = ( "Something bad happened with orchestral stuff", "at com.orchestral.rhapsody.execution.route.spi.conditions.ConnectorExecutor.accepts(ConnectorExecutor.java:4)", "and I don't know what to do about this execution failure", "but execution of orchestral stuff is important", ); # Convert search strings into regular expressions my @ParseRegExElements = (); foreach my $ParseString (@ARGV) { my $RequestedRegEx = quotemeta $ParseString; push @ParseRegExElements, $RequestedRegEx; } # To check for them only in the order given: print "\n-----[ Must occur in the order given ]-----\n"; { my $ParseRegEx = join '.*', @ParseRegExElements; my @LogMatch = grep /$ParseRegEx/, @LogBuffer; foreach (@LogMatch) { print "Match: [$_]\n"; } } # To check for them in any order: print "\n-----[ May occur in any order ]-----\n"; { my $SearchDirection = (-1); # If == -1: Searching @LogBuffer into @LogMatch # If == 0: Searching @LogMatch into @NewMatch # If == 1: Searching @NewMatch into @LogMatch my @LogMatch = (); my @NewMatch = (); foreach my $ParseRegEx (@ParseRegExElements) { if ($SearchDirection == (-1) ) { @LogMatch = grep /$ParseRegEx/, @LogBuffer; } elsif ($SearchDirection == 0) { @NewMatch = grep /$ParseRegEx/, @LogMatch; } elsif ($SearchDirection == 1) { @LogMatch = grep /$ParseRegEx/, @NewMatch; } # Toggle Direction $SearchDirection = 1 - abs($SearchDirection); } if ($SearchDirection == 0) { foreach (@LogMatch) { print "Match: [$_]\n"; } } else { foreach (@NewMatch) { print "Match: [$_]\n"; } } } print "\n-----[ Done]-----\n"; exit; __END__ #### D:\PerlMonks>parse1.pl orchestral execution -----[ Must occur in the order given ]----- Match: [at com.orchestral.rhapsody.execution.route.spi.conditions.ConnectorExecutor.accepts(ConnectorExecutor.java:4)] -----[ May occur in any order ]----- Match: [at com.orchestral.rhapsody.execution.route.spi.conditions.ConnectorExecutor.accepts(ConnectorExecutor.java:4)] Match: [but execution of orchestral stuff is important] -----[ Done]-----