apache-splice-logs is a very simple Perl script which can be used to combine several Apache log files covering the same time period into a single log file with the entries in chronological order. It is useful for analysing the log files of several servers with software such as AWStats.
Here is an example of using it:
$ ./apache-splice-logs server1.log server2.log > all.log
The script is available at apache-splice-logs and there is no installation required but you must have a working Perl, see the requirements section below.
You need a working installation of Perl and CPAN to be able to install autodie and HTTP::Date modules if you don't have them yet. No specifically recent version of neither Perl nor these modules is required (although it was only tested with 5.10 and 5.12 so please let us know if it doesn't work with 5.8 or earlier versions for you).
The script accepts any number of files (including one, although this is not very useful) on the command line and outputs all of their entries in chronological order on the standard output.
The files must be in Apache common log format or any other format using similar structure (e.g. combined), the script only relies on having the date in the fourth field of each line.
This script is Free Software released under BSD license.