Analyze IIS Log File Quickly

First of all install LogParser

If you need to know the list of pages into your IIS log file requiring much time to execute you can use this command:

logparser "SELECT TOP 100 time-taken, cs-uri-stem INTO top_time_taken.log FROM D:\Log\IIS\W3SVC575153671\ex090910.log WHERE extract_extension(to_lowercase(cs-uri-stem)) = 'aspx' ORDER BY time-taken DESC" -i:iisw3c -o:tsv
logparser "SELECT AVG(time-taken) As AverageTimeTaken, cs-uri-stem INTO top_time_taken.log FROM D:\Log\IIS\W3SVC575153671\ex090910.log WHERE extract_extension(to_lowercase(cs-uri-stem)) = 'aspx' or extract_extension(to_lowercase(cs-uri-stem)) = 'ashx' GROUP BY cs-uri-stem ORDER BY AverageTimeTaken DESC" -i:iisw3c -o:tsv


If you need to know the list of file extension more present into your log file you can use this command:

logparser "select extract_extension(cs-uri-stem) as Resource, mul(propcount(*),100.0) as ResourceHits into percentage.jpg from D:\Log\IIS\W3SVC575153671\ex090910.log group by Resource order by ResourceHits desc" -chartType:PieExploded3D -chartTitle:"Percentages per data type" -categories:off -o:chart -i:iisw3c
LogParser "SELECT TO_UPPERCASE(EXTRACT_EXTENSION(cs-uri-stem)) AS PageType, MUL(PROPSUM(sc-bytes),100.0) AS Bytes INTO Pie.gif FROM D:\Log\IIS\W3SVC575153671\ex090910.log GROUP BY PageType ORDER BY Bytes DESC" -chartType:PieExploded -chartTitle:"Bytes per data type" -categories:off -o:chart -i:iisw3c


Obviously you can use a more complex IIS Log file Analyzer such as Awstats but if you want a simple and quick iis log reporting tool or do a one shot log analysis this is the best solution.
Share on Google Plus

About Vittorio Pavesi

    Blogger Comment
    Facebook Comment

0 commenti: