scott_sams_8256
Feb 20, 2009Nimbostratus
content tracking
we found an irule here by Kirk (thanks Kirk) that breaks content down by count. any genius out there that can take this and add total bytes for each category? our ecomm group wants to see the breakdown in the classification of traffic.
thanks!
Content_ Type_ Tracking
Enter a topic name to show or a new topic name to create; then press Enter
.
Contributed by: kirkbauer - kirk@f5.com
Description
Have you ever wondered what types of content are served by your web servers? Have you wondered how many requests could be offloaded to the BIG-IP if you added the RAM Cache module? Or maybe how much acceleration you may get from WebAccelerator ? Try out this iRule. Most of the time everything other than the HTML pages should be cacheable.
iRule Source
First, create statistics profile named "ContentType" with following entries:
HTML
Images
Scripts
Documents
Stylesheets
Other
Now associate this Statistics Profile to the virtual server. Then apply the following iRule.
To view the results, go to Statistics -> Profiles - Statistics
when HTTP_RESPONSE {
switch -glob [HTTP::header "Content-type"] {
"image/*" { STATS::incr "ContentType" "Images" }
"text/html" { STATS::incr "ContentType" "HTML" }
"text/css" { STATS::incr "ContentType" "Stylesheets" }
"*javascript" { STATS::incr "ContentType" "Scripts" }
"text/vbscript" { STATS::incr "ContentType" "Scripts" }
"application/pdf" { STATS::incr "ContentType" "Documents" }
"application/msword" { STATS::incr "ContentType" "Documents" }
"application/*powerpoint" { STATS::incr "ContentType" "Documents" }
"application/*excel" { STATS::incr "ContentType" "Documents" }
"default" { STATS::incr "ContentType" "Other" }
}
}