<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.iis.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:cs="http://blogs.iis.net/"><channel><title>rakkimk : Logging</title><link>http://blogs.iis.net/rakkimk/archive/tags/Logging/default.aspx</link><description>Tags: Logging</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>LogParser – Useful Logparser scripts</title><link>http://blogs.iis.net/rakkimk/archive/2008/11/18/logparser-useful-logparser-scripts.aspx</link><pubDate>Wed, 19 Nov 2008 02:33:06 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:2753976</guid><dc:creator>rakkimk</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/rakkimk/rsscomments.aspx?PostID=2753976</wfw:commentRss><comments>http://blogs.iis.net/rakkimk/archive/2008/11/18/logparser-useful-logparser-scripts.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://www.logparser.com"&gt;Logparser&lt;/a&gt; is a powerful utility which comes handy for me whenever I’m helping my customers facing a problem with slow running pages, frequently hit pages, post mortem analysis to find what went wrong on IIS, et al. You can use Logparser to parse your IIS logs to health check the state of your server, and the requests it had served. Below are few LogParser scripts, and their corresponding output in chart format – you can choose your own format, but isn’t a picture worth a 1000 words? &lt;/p&gt;  &lt;p&gt;Note : change the GIF file location, and chartType to get more awesome images. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Finding Top 20 hit URLs&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&amp;gt; logparser &amp;quot;select top 20 cs-uri-stem, count(*) as Hits into c:\mychart.gif from c:\inetpub\logs\logfiles\w3svc1\*.log group by cs-uri-stem order by Hits DESC&amp;quot; -i:w3c -chartType:barstacked -view:on&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://blogs.iis.net/blogs/rakkimk/image_2EBE5C55.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.iis.net/blogs/rakkimk/image_thumb_1B9FC05A.png" width="542" height="426" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Finding Error codes&lt;/u&gt;       &lt;br /&gt;&lt;/strong&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;gt; logparser &amp;quot;select sc-status, count(*) as Hits into mychart.gif from c:\inetpub\logs\logfiles\w3svc1\*.log group by sc-status&amp;quot; -i:w3c -chartType:pieexploded3d -view:on&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://blogs.iis.net/blogs/rakkimk/image_282FFE27.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.iis.net/blogs/rakkimk/image_thumb_3E88341D.png" width="542" height="405" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Finding the top 10 client IPs&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&amp;gt; logparser &amp;quot;select top 10 c-ip, count(*) as Hits into mychart.gif from c:\inetpub\logs\logfiles\w3svc1\*.log group by c-ip order by Hits DESC&amp;quot; -i:w3c -chartType:bar3d -view:on&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://blogs.iis.net/blogs/rakkimk/image_75F366AD.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.iis.net/blogs/rakkimk/image_thumb_7E0D23B3.png" width="542" height="419" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Slow running pages&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&amp;gt; logparser &amp;quot;select top 10 cs-uri-stem, time-taken from c:\inetpub\logs\logfiles\w3svc1\*.log order by time-taken DESC&amp;quot; -i:w3c&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;     &lt;br /&gt;cs-uri-stem&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; time-taken       &lt;br /&gt;------------------------------------------&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ----------       &lt;br /&gt;/IRTcalculator/default.aspx&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 101262       &lt;br /&gt;/TestingWebsite/WebsiteThumbnailImage.aspx&amp;#160; 42495       &lt;br /&gt;/IRTcalculator/default.aspx&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 33711       &lt;br /&gt;/Qod/ScoreCard.aspx&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 28672       &lt;br /&gt;/IRTcalculator/default.aspx&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 24802       &lt;br /&gt;/IRTcalculator/default.aspx&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 24169       &lt;br /&gt;/IRTcalculator/default.aspx&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 22732       &lt;br /&gt;/QoD/&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 20967       &lt;br /&gt;/IRTcalculator/default.aspx&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 20358       &lt;br /&gt;/IRTcalculator/default.aspx&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 19281 &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This above query will list you the top 10 URL’s which are taking more time – be informed that this time-taken field in IIS 6/7 will contain the network time to, this is just not only the IIS processing time. &lt;/p&gt;  &lt;p&gt;More to come! Hope this helps.&lt;/p&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=2753976" width="1" height="1"&gt;</description><category domain="http://blogs.iis.net/rakkimk/archive/tags/Logging/default.aspx">Logging</category><category domain="http://blogs.iis.net/rakkimk/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.iis.net/rakkimk/archive/tags/LogParser/default.aspx">LogParser</category></item><item><title>How to configure IIS 7.0 for ODBC logging?</title><link>http://blogs.iis.net/rakkimk/archive/2008/04/16/how-to-configure-iis-7-0-for-odbc-logging.aspx</link><pubDate>Wed, 16 Apr 2008 20:54:46 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:2302607</guid><dc:creator>rakkimk</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/rakkimk/rsscomments.aspx?PostID=2302607</wfw:commentRss><comments>http://blogs.iis.net/rakkimk/archive/2008/04/16/how-to-configure-iis-7-0-for-odbc-logging.aspx#comments</comments><description>&lt;p&gt;If you select Log File format as &amp;#8220;Custom&amp;#8221; in the IIS manager, it doesn&amp;#8217;t give you options to configure ODBC logging in the UI. Instead, it just gives you an alert saying it cannot be configured through IIS manager which you already know. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.iis.net/blogs/rakkimk/WindowsLiveWriter/60aa23eba27b_133B/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="94" alt="image" src="http://blogs.iis.net/blogs/rakkimk/WindowsLiveWriter/60aa23eba27b_133B/image_thumb.png" width="205" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;But, in the previous versions of IIS, you would see the below: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.iis.net/blogs/rakkimk/WindowsLiveWriter/60aa23eba27b_133B/clip_image004_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="314" alt="clip_image004" src="http://blogs.iis.net/blogs/rakkimk/WindowsLiveWriter/60aa23eba27b_133B/clip_image004_thumb.jpg" width="351" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;So, in this post I will explain how to configure IIS7.0 site for ODBC logging. You still want to check out &lt;a href="http://support.microsoft.com/kb/245243"&gt;this KB&lt;/a&gt; for the database, table related information which needs to be created prior to this IIS configuration change. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Changing LogFile Format and the customLogPluginClsid&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;To configure ODBC, you might need to know the log plugin ID for the ODBC logging. In IIS 6.0, it was LogModuleId, and if you do a search for &amp;#8220;ODBC logging&amp;#8221; in your Metabase.XML file, you might find this property with value &amp;#8220;{FF16065B-DE82-11CF-BC0A-00AA006111E0}&amp;#8221;. We are going to use the same in IIS 7.0, but in the ApplicationHost.config file as customLogPluginClsid. &lt;/p&gt;  &lt;p&gt;You need to find the &amp;lt;logFile&amp;gt; node in ApplicationHost.config, and that should look like below:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;logFile customLogPluginClsid=&amp;quot;{FF16065B-DE82-11CF-BC0A-00AA006111E0}&amp;quot; logFormat=&amp;quot;Custom&amp;quot; /&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Below are the AppCmds to do this:&lt;/p&gt;  &lt;blockquote&gt;appcmd set site /site.name:&amp;quot;Default Web Site&amp;quot; /logFile.customLogPluginClsid:&amp;quot;{FF16065B-DE82-11CF-BC0A-00AA006111E0}&amp;quot;    &lt;br /&gt;appcmd site set /site.name:&amp;quot;Default Web Site&amp;quot; /logFile.logFormat:&amp;quot;Custom&amp;quot; &lt;/blockquote&gt;  &lt;p&gt;Now, we have just configured IIS to use ODBC logging for our default website. We still need to configure the required DSN name, table-name, username and password to do the ODBC logging. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Configuring ODBC logging parameters in ApplicationHost.config&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;After you&amp;#8217;ve followed &lt;a href="http://support.microsoft.com/kb/245243"&gt;this KB article&lt;/a&gt; to create database, table, and DSN, you need to make sure you configure ApplicationHost.config to contain the information. You need to configure those settings in &amp;lt;odbcLogging&amp;gt; node under &amp;lt;system.webServer&amp;gt;. Below is my sample configuration:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;location path=&amp;quot;Default Web Site&amp;quot;&amp;gt;      &lt;br /&gt;&amp;#160; &amp;lt;system.webServer&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;odbcLogging dataSource=&amp;quot;ODBCLogging&amp;quot; tableName=&amp;quot;HTTPLog&amp;quot; userName=&amp;quot;Username&amp;quot; password=&amp;quot;mypassword&amp;#8221; /&amp;gt;&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/system.webServer&amp;gt;       &lt;br /&gt;&amp;lt;/location&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Below are the AppCmds to configure the above attributes for the site:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;appcmd set config &amp;quot;Default Web Site&amp;quot; /section:odbcLogging /dataSource:&amp;quot;ODBCLogging&amp;quot; /commit:appHost      &lt;br /&gt;appcmd set config &amp;quot;Default Web Site&amp;quot; /section:odbcLogging /tableName:&amp;quot;ODBCLogTable&amp;quot; /commit:appHost       &lt;br /&gt;appcmd set config &amp;quot;Default Web Site&amp;quot; /section:odbcLogging /userName:&amp;quot;Username&amp;quot; /commit:appHost       &lt;br /&gt;appcmd set config &amp;quot;Default Web Site&amp;quot; /section:odbcLogging /password: &amp;quot;mypassword&amp;quot; /commit:appHost &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Also, we do not support configuring ODBC logging feature in IIS using the SQL Native Client ODBC driver. You must use the SQL Server ODBC driver. You might want to take a look at this &lt;a href="http://support.microsoft.com/kb/931202"&gt;KB article&lt;/a&gt; on this. &lt;/p&gt;  &lt;p&gt;Hope this helps! Do post a comment if you have any questions on this. &lt;/p&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=2302607" width="1" height="1"&gt;</description><category domain="http://blogs.iis.net/rakkimk/archive/tags/IIS7/default.aspx">IIS7</category><category domain="http://blogs.iis.net/rakkimk/archive/tags/Logging/default.aspx">Logging</category></item></channel></rss>