[CentOS] Sort logfiles at rotation time
Les Mikesell
lesmikesell at gmail.com
Mon Nov 9 19:46:47 UTC 2009
Stephen Nelson-Smith wrote:
> 2009/11/9 Kai Schaetzl <maillists at conactive.com>:
>> Stephen Nelson-Smith wrote on Mon, 9 Nov 2009 16:45:35 +0000:
>>
>>> Because within apache, you can't necessarily guarantees strict
>>> chronological order of log entries. If, for example, php takes a
>>> couple of seconds to run, the request could come a couple of seconds
>>> before the log entry is written
>> Is it possible that everyone misunderstood your question?
>> You want to sort the *content* of the log files, so the content is in
>> chronological order?
>
> Precisely so.
>
>> I do not see much value in this.
>
> My client requires it, so there is value for him :)
>
>> But you may try mergelog for this purpose.
>> http://mergelog.sourceforge.net/
>
> I'll check it out.
There is also a perl script called logresolvemerge.pl that is part of
the awstats program that may work - although I'm not sure if either of
these will adjust out-of-order source files. They are intended to merge
already sorted files into one for analyzers that aren't bright enough
to do it themselves. Analog complains about possible duplication but
doesn't seem to choke if you just give it a big list of files.
--
Les Mikesell
lesmikesell at gmail.com
More information about the CentOS
mailing list