Wednesday, February 10, 2010

Parse apache log for page requests that trigger 500 error

Posting this so I don't need to remember how to get this info.

To parse an apache log for the requests that are status code 500 (internal server error):

'cat /path/to/access/log/file' | awk '{print $7, $9}' | grep ' 500'

Provides output like:

/blah/xyz.php 500
/bleh/abc.php 500
/xxx/yyy.php 500