RE: Sorting out of sequence log Apache log file



Ray Van Dolson <mailto:rayvd@xxxxxxxxxxxxxxx>
on Wednesday, April 26, 2006 12:43 PM said:

I assume by out of sequence you mean the time stamps are all off?

Yes.

The following quickie Python hack works for me. Basically call it as
follows:

% cat access_log | /path/to/sort_apache.py > sorted_log.log

Thanks Ray. I had some issues with the indentation originally (never
used Python before) but I've got that sorted out now.

If it's a huge logfile the script may give you some problems.
Basically it reads in all the lines in the file and sorts by the date
and time and then spits it out in the right order.

Thanks for the heads up.




Chris.

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list



Relevant Pages