This Log Parser query assumes that the logs are in
c:\logs\web and that IIS has been configured to log in Microsoft's W3C extended
log format. With modified syntax this query could be used to analyze log files
in other formats.
The query can be run from a DOS prompt within the Log Parser
installation folder. To save excessive typing or pasting into command prompt
windows the whole query can be saved as a .bat file.
logparser "SELECT [cs-uri-stem], [cs-uri-query],
Count(*) AS [Hits]
WHERE sc-status = 500
order by [hits], [cs-uri-stem] DESC" -rtp:-1
Once the query has been put into a batch file
(Find500Errors.bat), it can be run using the following when typed at the
command prompt (which will produce an output file called 500Errors.txt).
Find500Errors.bat > 500Errors.txt