Not quite sure what you mean but assuming you have a number of logs all in one folder, then this script will scan them and extract only the records you are interested in into a single file which you can process with the 'bad user' script.
#!perl
use strict;
# start time
my $t0 = time();
# input - create list of files
my @files = grep { /.log/ } glob("*") ;
# output
my $count_out = 0;
my $outfile = 'output.log';
open OUT,'>',$outfile or die "Could not open $outfile : $!";
# process
for my $infile (@files){
next if ($infile eq $outfile);
open IN,'<',$infile or die "Could not open $infile : $!";
print "Reading $infile .. ";
my $count_in = 0;
while (<IN>){
++$count_in;
if (/BIND|SRCH=Q/){
print OUT;
++$count_out;
}
}
close IN;
print "$count_in records read\n";
}
# finish
close OUT;
my $dur = time() - $t0;
print "Finished in $dur secs \n $count_out written to $outfile\n";
poj |