Small Mosaic


Categories:

/books
/career
/codinghorrors
/events
/geekstuff
/justdont
/languages
/languages/bash
/linkshot
/magazines
/meta
/misctech
/movies
/nottech
/operatingsystems
/operatingsystems/linux
/operatingsystems/linux/debian
/operatingsystems/solaris
/perl
/presentations
/programming
/python
/ruby
/security
/security/apache
/security/tools
/serversmells
/services
/services/dns
/sites
/specifications
/sysadmin
/testing
/tools
/tools/commandline
/tools/firefox
/tools/gui
/tools/network
/tools/online
/tools/online/greasemonkey
/tools/puppet
/unixdaemon

Archives:

July 20111
June 20112
May 20113
April 20112
March 20117
January 20111
December 20103
November 20103
August 20101
July 20101
June 20104
May 20102
April 20101
March 20108
February 20101
January 20102
Full Archives

Sat, 16 Oct 2004

Apache Error log to Access log date converter
As part of my daily server housekeeping I keep an eye on the Apache error logs for each of the servers I'm responsible for. If it's a quiet day I'll grep through the attempted exploits, attacks and formmail scans for any useful error messages. While attempting to track some 404's back to the corresponding access-log entries I got bored of converting the error logs date format into the default date format of the access log so I wrote a small bit of shell that I (badly) named ApacheErrorDate.sh but without the studly caps, to do it for me.

You invoke the script on the command line with a single argument, the error log date string you want to convert. The script will then return a string in the access log format. If you want to paste the returned string directly into your editor of choice (I tested this with vim) then you can supply the -e option to have the slashes escaped to stop vim treating it as a substitution command.

I've added the short script, with a download link and brief introduction, to the MiniProjects page under the Apache Error log to Access log date converter header.

Like this post? - Digg Me! | Add to del.icio.us! | reddit this!

Posted: 2004/10/16 16:47 | /tools/commandline | Permanent link to this entry | This entry and same date


books career codinghorrors events geekstuff justdont magazines meta misctech movies nottech operatingsystems/linux operatingsystems/linux/debian operatingsystems/solaris perl programming python ruby security security/apache security/tools serversmells services/dns sites sysadmin testing tools tools/commandline tools/firefox tools/gui tools/network tools/online tools/online/greasemonkey tools/puppet unixdaemon

Copyright © 2000-2010 Dean Wilson XML feed logo