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

  • Pythonic indentation (or: beating a dead horse)
    ... I'm a bit of a Ruby Nuby who's ... any Python fan who wants to deride "monkeypatching" can shove it. ... and now I think that using indentation to define scope is ...
    (comp.lang.ruby)
  • Re: OT - trivial programming language
    ... |> That makes two votes for Python. ... If you think indentation doesn't matter, join any C, C++ or Java ... keyboard engraved with the label 'Tab' is pressed. ... If you use vim, set the following options. ...
    (Debian-User)
  • Re: A decorator syntax not yet mentioned (I think!)
    ... Because to me it doesn't *act* like normal Python. ... except for the few that are based on indentation ... It seems like we both agree that the @pie syntax doesn't ...
    (comp.lang.python)
  • Re: Structure using whitespace vs logical whitespace
    ... IMO Newsgroup and email clients should not remove indentation. ... Python's choice to give semantic meaning to whitespace prevents me ... When I first learned python I was occasionally bothered by this. ... I certainly would not consider changing the language ...
    (comp.lang.python)
  • Re: Hows ruby compare to it older brother python
    ... >>to Perl than to Python. ... > as syntax and Ruby doesn't. ... As I said in another post, indentation is the reason I learned ...
    (comp.lang.python)