LOG Parser – IIS Charts


In this post I will show some examples how to create some charts from information collected in IIS Logfiles. For this purpose I will use LogParser version 2.2. and Office Web Components.

You can download LogParser version 2.2 here – http://www.iis.net/community/default.aspx?tabid=34&g=6&i=1976 and read more about it here http://technet.microsoft.com/en-us/library/bb878032.aspx

You can download Office Web Components here http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=22276

Let’s begin.

From command prompt run LogParser -h -o:CHART  for Help menu.

C:\Program Files\Log Parser 2.2>LogParser -h -o:CHART
Output format: CHART (Chart Output Format)
Writes output to a chart image file
INTO syntax:
 <filename>
 Chart output image filename
Parameters:
 -chartType         <chart type>       : Chart type; one of: Line,
                                         LineMarkers, LineStacked,
                                         LineStackedMarkers, LineStacked100,
                                         LineStacked100Markers, Line3D,
                                         LineOverlapped3D, LineStacked3D,
                                         LineStacked1003D, SmoothLine,
                                         SmoothLineMarkers, SmoothLineStacked
                                         , SmoothLineStackedMarkers,
                                         SmoothLineStacked100, SmoothLineStac
                                         ked100Markers, BarClustered,
                                         BarStacked, BarStacked100, Bar3D,
                                         BarClustered3D, BarStacked3D,
                                         BarStacked1003D, ColumnClustered,
                                         ColumnStacked, ColumnStacked100,
                                         Column3D, ColumnClustered3D,
                                         ColumnStacked3D, ColumnStacked1003D,
                                         Pie, PieExploded, PieStacked, Pie3D,
                                         PieExploded3D, ScatterMarkers,
                                         ScatterSmoothLine, ScatterSmoothLine
                                         Markers, ScatterLine, ScatterLineMar
                                         kers, ScatterLineFilled, Bubble,
                                         BubbleLine, Area, AreaStacked,
                                         AreaStacked100, Area3D, AreaOverlapp
                                         ed3D, AreaStacked3D, AreaStacked1003
                                         D, Doughnut, DoughnutExploded,
                                         RadarLine, RadarLineMarkers,
                                         RadarLineFilled, RadarSmoothLine,
                                         RadarSmoothLineMarkers, StockHLC,
                                         StockOHLC, PolarMarkers, PolarLine,
                                         PolarLineMarkers, PolarSmoothLine,
                                         PolarSmoothLineMarkers [default
                                         value=Line]
 -categories        ON|OFF|AUTO        : Display categories along the X-Axis;
                                         if AUTO, will display categories if
                                         the fields in the first column are
                                         STRING values [default value=AUTO]
 -maxCategoryLabels <max categories>   : Maximum number of category labels
                                         displayed along the X-Axis (0=auto,
                                         -1=unlimited) [default value=0]
 -legend            ON|OFF|AUTO        : Print legend for each series; if
                                         AUTO, will print legend if there are
                                         2 or more series [default
                                         value=AUTO]
 -values            ON|OFF|AUTO        : Print value labels; if AUTO, will
                                         decide based on the chart type
                                         [default value=AUTO]
 -groupSize         <width>x<height>   : Image size [default value=640x480]
 -fileType          GIF|JPG|AUTO       : Output file format; when AUTO,
                                         decides based on the extension of
                                         the file specified in the INTO
                                         statement [default value=AUTO]
 -config            <config scripts>   : Comma-separated list of
                                         configuration script filenames
                                         (JScript or VBScript) for futher
                                         customization [default value=not
                                         specified]
 -chartTitle        <any string>       : Title of this chart; if 'Auto' and 1
                                         series only, will use the series'
                                         field name [default value=Auto]
 -oTsFormat         <timestamp format> : Format in which TIMESTAMP fields are
                                         rendered [default value=yyyy-MM-dd
                                         hh:mm:ss]
 -view              ON|OFF             : Show the image when done [default
                                         value=OFF]
Examples:
 Create a chart containing the TOP 20 URL's in the "www.margiestravel.com"
  web site (assumed to be logging in the W3C log format):
     LogParser "SELECT TOP 20 cs-uri-stem, COUNT(*) AS Hits INTO MyChart.gif
     FROM <www.margiestravel.com> GROUP BY cs-uri-stem ORDER BY Hits DESC"
     -chartType:Column3D -groupSize:1024x768
 Create a pie chart with the total number of bytes generated by each
  extension:
     LogParser "SELECT EXTRACT_EXTENSION(cs-uri-stem) AS Extension,
     MUL(PROPSUM(sc-bytes),100.0) AS Bytes INTO Pie.gif FROM <1> GROUP BY
     Extension ORDER BY Bytes DESC" -chartType:PieExploded -chartTitle:"Bytes
     per extension" -categories:off

There are multiple types of charts that you can use, so is up to you to decide witch one to use. For this post I will use Bar, Line, and Pie charts.

From this earlier post https://rodolfovaraujo.wordpress.com/2012/04/24/log-parser-iis-logs-analysis/, I will use the example:

Number of hits per Method (GET, POST, etc)

SELECT cs-method As Method, COUNT(*) As Hits FROM H:\LOGSIIS\W3SVC1\* GROUP BY Method

Output

Method,Hits
 GET,1088636
 POST,24746
 OPTIONS,593
 HEAD,147
 PROPFIND,12
Statistics:
 -----------
 Elements processed: 1114134
 Elements output:    5
 Execution time:     2.46 seconds

 

Line Char Example

LogParser.exe -i:W3C "SELECT cs-method As Method, COUNT(*) As Hits into h:\logsiis\line.gif
FROM H:\LOGSIIS\W3SVC1\* GROUP BY Method" -o:chart -stats:OFF

Char Output 

Pie Char Example

LogParser.exe -i:W3C "SELECT cs-method As Method, COUNT(*)
As Hits into h:\logsiis\pie.gif FROM H:\LOGSIIS\W3SVC1\* 
GROUP BY Method" -chartType:PieExploded3d -o:chart -stats:OFF  -categories:off

Char Output

 

Bar Chart example

LogParser.exe -i:W3C "SELECT cs-method As Method, COUNT(*) As Hits into h:\logsiis\bar.gif 
FROM H:\LOGSIIS\W3SVC1\* GROUP BY Method" -chartType:BarClustered3D -o:chart
Statistics:
-----------
Elements processed: 1114134
Elements output:    5
Execution time:     2.26 seconds

Char Output

You can see below that were processed 1 114 134 elements and only took 2,26 seconds, you can easly and fast give and present some information related to your web infra-strucure.

Statistics:
-----------
Elements processed: 1114134
Elements output:    5
Execution time:     2.26 seconds

Hope that this examples and earlier post can be useful, tank you for reading and visiting.

Advertisements

About rodvars
Been working in IT Services/Consulting for the past 15 years. My main areas of work are planning, development, managing and administration System infrastructures focusing on optimizing user processes, enforcing business security, performance enhancements, high availabilty and infrastucture scalability.

5 Responses to LOG Parser – IIS Charts

  1. Pingback: Log parsing Working Event Viwer data « Another MSFT Knowledge Base

  2. Shakia Isip says:

    Thanks for your wonderful article! I definitely appreciated reading through it, you may be a superb article writer. I’m going to be sure to bookmark your website and may revisit at some point.

  3. Pilar Kamper says:

    Thank you, I have recently been looking for info in regards to this topic forever and this website is the best I’ve discovered thus far.

  4. I was particularly glad to find this web page. I want to give you thanks for your time invested publishing this terrific write-up. I definitely liked each individual little bit of it and I have you saved to fav to look at new articles on your site.

  5. Great blog, thanks for share this article with us

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: