Search my blog

Some of my readers



In this blog entry we will display the same output in a number of different formats that Log Parser is capable of providing.

Default

Using the default output format the results are displayed inside of the command prompt.

SELECT top 25 distinct c-ip as ClientIP, Count(*) as Hits
FROM \\sbs2003\LogFiles\W3SVC68783193\ex0508*.log
group by c-ip
order by Hits, c-ip desc


Command Line

LogParser.exe file:distinctclientrequests.sql

Output

Notice in the above listing you get a "Press a key..." displayed you can turn this off if you use the -rtp:-1 switch

Chart

Using an output format of a chart you can create nice graphs of log entries

SELECT top 25 distinct c-ip as ClientIP, Count(*) as Hits
into test.gif
FROM \\sbs2003\LogFiles\W3SVC68783193\ex0508*.log
group by c-ip
order by Hits, c-ip desc


Command Line

LogParser.exe file:distinctclientrequests.sql -view

Output

The output in this case is a file on disk called test.gif. and the -view parameter displays it in a window.


 

DataGrid

Using an output format of a DataGrid you can view the results inside of a grid which is a lot easier for viewing the results in certain circumstances.

SELECT top 25 distinct c-ip as ClientIP, Count(*) as Hits
into DATAGRID
FROM \\sbs2003\LogFiles\W3SVC68783193\ex0508*.log
group by c-ip
order by Hits, c-ip desc


Command Line

LogParser.exe file:distinctclientrequests.sql

Output

posted on Wednesday, August 24, 2005 4:41 PM | Filed Under [ IIS IIS - Log Parser IIS / Tools / Log Files ]