Configuring AWStats for Response Time Parameters

Recently I was looking at various web log analysers that I can use with Apache to generate standard and custom statistics. The package that seemed most promising was AWStats. AWStats does a great job, especially with standard statistics. It is also very easy to install.

However, if you want to see performance related attributes in AWStats, you need to use the “Extra Sections” in AWStats. I was interested in the response time parameter for a query in Apache. As a result, my Apache LogFormat looks something like:

>LogFormat “%h %u %l %t ”%r” %>s %b ”%{Referer}i” ”%{User-Agent}i” %T %D” 443_combined

Where %T represents the response time in seconds (useless as most requests are performed in under a second) and %D represents the response time in microseconds. The 443_combined is the nickname you can give to your LogFormat string, and then use this nick name to format when defining log files. You can call it anything.

Equivalent AWStats log format is:

>LogFormat=”%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot %other %extra1″

And to show the %extra1 parameter in the graphical page, you use the EXTRA SECTIONS.

ExtraSectionName1="Response Time (in microseconds)"
ExtraSectionCodeFilter1="200 304"
ExtraSectionCondition1="URL,/"
ExtraSectionFirstColumnTitle1="Response Time"
ExtraSectionFirstColumnValues1="extra1,([0-9]*)$"
ExtraSectionFirstColumnFormat1="%s"
ExtraSectionStatTypes1=P
ExtraSectionAddAverageRow1=0
ExtraSectionAddSumRow1=0
MaxNbOfExtra1=200
MinHitExtra1=1

Details of these parameters are in sample AWStats config file.

To configure AWStats to keep the data before Apache logs are rotated, you can write a pre-rotate routine in /etc/logrotate.d/apache2 just above postrotate, e.g.

>prerotate /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -update -config=/etc/awstats/awstats.YOUR-CONFIG-FILE-NAME.conf

1 comments On Configuring AWStats for Response Time Parameters

Leave a reply:

Your email address will not be published.

Site Footer

Sliding Sidebar

About Me

About Me

Strategy, Leadership, Innovation and Code Monkeyism

Social Profiles

Latest Tweets