On the basis of what you've said about the data, it could be as simple as this:
#! perl -slw
use strict;
my $dir = $ARGV[ 0 ] || die 'Need a directory';
my %hash;
while( my $file = <"$dir/*.log"> ) {
open my $fh, '<', $file or die "$file : $!";
while( <$fh> ) {
$hash{ $_ } = 1;
}
close $fh;
}
open my $fh, '>', "$dir/composite.log" or die $!;
print $fh $_ for sort keys %hash;
close $fh;
This assumes that all 31 log files from a particular server are located in a single directory, no other files are in that directory, and that the lines can be sorted using an alphanumeric sort. Eg. Each line carries a date/time stamp at the beginning of the line, and it is ordered in some sensible form (YYYYMMDD HH:MM:SS) that will sort correctly.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|