Although a really old tool, I still use Log Parser from time to time to parse log files. It is really fast and can parse large amount of data in a short time. And if you are afraid of the complexity of the tool, you can first try the Log Parser Studio which simplifies the usage of Log Parser.
My main use case is to parse IIS logs and extract useful information from it. However recently Log Parser no longer processed the IIS log files and the results remained empty.
What is going on?! Let’s find out…
The first thing I noticed that was different compared to before is that the IIS Log files had a slightly different naming format; a ‘_x’ was added to every log file:
Inside the documentation I found the following explanation:
Once custom fields have been configured, IIS will create new text log files with "_x" appended to the file name to indicate that the file contains custom fields.
And indeed when I check the log file I could see that a few ‘crypt-‘ fields are added:
It seems that Log Parser Studio doesn’t like this extra fields. The good news is that I can still directly use the log parser tool.
I added the query to a SQL file:
And executed the following command:
LogParser -i:W3C -O:DATAGRID file:"c:\example.sql"
Remark: the query expects that the log files are at the specified location.
Now I did got result back.
Great!
More information
Parsing logfiles (bartwullems.blogspot.com)
Log Parser Studio (bartwullems.blogspot.com)
Enhanced Logging for IIS 8.5 | Microsoft Learn
Download Log Parser 2.2 from Official Microsoft Download Center