SQL – Log Parser Studio

| |

Log Parser Studio is a great free tool from Microsoft TechNet Gallery that allows you to run SQL statements against Log files.

This tool is available as a Zip file, once extracted open “LPS.exe”.

Load Log File(s)
Load Log File(s)

Two examples are below but there is also a category (Code – SQL – Log Parser Studio) for more detailed queries.

SELECT TOP 10 [LogFilename]
	,[c-ip]
	,[date]
	,[time]
	,[cs-uri-stem]
	,[time-taken]
	,[sc-status]
FROM '[LOGFILEPATH]'
SELECT TOP 25  
    STRCAT(TO_STRING(sc-status),  
    STRCAT('.', TO_STRING(sc-substatus))) As Status,  
    COUNT(*) AS Hits  
    FROM '[LOGFILEPATH]'  
GROUP BY Status  
ORDER BY Hits DESC 
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.