

This will open a window with a data grid: If you want to specify the Output Format, you can do so with the “-o” option: LogParser file:errors_by_day.sql -o:DATAGRID So it makes sense to use the CSV Output Format. In our example, the file had a CSV extension. Just like Input Formats, Log Parser is smart enough to use the correct Output Format in some cases. To continue with our example, this query will write the results to a CSV file: SELECT QUANTIZE(TimeGenerated, 86400) AS Day, COUNT(*) AS To write the results to a file, you can simply add the “INTO” clause to your query.
#MEDIA CENTER MASTER DOWNLOAD PARSER PROBLEM WINDOWS#
However, this “Application” points to the Application log of the Windows Event Log.

In the above query, it seems we selected certain columns from an “Application” table in some database. But there are other tools that provide you such features. Log Parser has no concept of a dashboard to take a quick glance at the status of your application. Unfortunately, it’s a bit of a hassle to execute your favorite queries every time you want to get some insights. There’s a lot of data to be extracted from IIS logs. This is a powerful way to get ad-hoc statistics from your IIS logs: performance, user agents, HTTP response codes, IP addresses, requested addresses, etc. On my computer, this produces the following result:

We can put this query in a SQL file and format it nicely like below: SELECT QUANTIZE(TimeGenerated, 86400) AS Day, COUNT(*) AS But it’s a long statement that we have to keep on one line. You can run this in the installation folder of Log Parser. This query will show us the number of errors per day in the Application event log: LogParser "SELECT QUANTIZE(TimeGenerated, 86400) AS Day, COUNT(*) AS FROM Application WHERE EventType = 1 OR EventType = 2 GROUP BY Day ORDER BY Day ASC" Basically, you point Log Parser to a source, tell it what format the logs are in, define a query, and write the output somewhere.Īn example will make this clear. This makes it a useful tool for searching through large and/or multiple logs. Log Parser will parse a variety of logs in such a way that you can execute SQL-like queries on them. Log Parser Studio also comes with many default queries, which is very useful if you’re using the tool for the first time.

If you prefer, you can use Log Parser Studio, a graphical user interface that builds on top of Log Parser. Just download the installer from Microsoft or use Chocolatey. According to Microsoft, Log Parser “provides universal query access to text-based data such as log files, XML files, and CSV files, as well as key data sources on the Windows® operating system such as the Event Log, the Registry, the file system, and Active Directory®.” Also, it says, “The results of your query can be custom-formatted in text based output, or they can be persisted to more specialty targets like SQL, SYSLOG, or a chart.”
