Forum Discussion
scott_sams_8256
Nimbostratus
Feb 20, 2009content 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 breakd...
Jon_Strabala_46
Nimbostratus
Jul 02, 2011Looking at this post I guess I can do the below (simple basic example)
Question 1) but what would I have to (or should I) modify it work with a STREAM profile ?
Question 2) I assume that this does NOT impact the basic built in statistics ?
Question 3) When I make a new stats profile does it basically just build a "rrd" infrastructure ?
Question 4) there was alot of discussion in this thread BUT no single best practice was identified "hoolio" could you comment on this ?
As Scott said (above) I assume I have to first define a profile (Profile->Other-Statistics) and create a new named profile "content_and_len", then check "custum) with following entries:
Html
Html_len
Images
Images_len
Css
Css_len
Other
Other_len
Then associate this Statistics Profile to the virtual server.
Next I would have to the following iRule and then also associate that with the same virtual server, this iRULE will also tests for unset or missing length.
when HTTP_RESPONSE {
switch -glob [HTTP::header "Content-type"] {
"text/html" {
STATS::incr "ContentType" "Html"
if { [HTTP::header exists "Content-Length"] } {
STATS::incr "ContentType" "Html_len" [HTTP::payload length]
}
}
"image/*" {
STATS::incr "ContentType" "Images"
if { [HTTP::header exists "Content-Length"] } {
STATS::incr "ContentType" "Images_len" [HTTP::payload length]
}
}
"text/css" {
STATS::incr "ContentType" "Css"
if { [HTTP::header exists "Content-Length"] } {
STATS::incr "ContentType" "Css_len" [HTTP::payload length]
}
}
"default" {
STATS::incr "ContentType" "Other"
if { [HTTP::header exists "Content-Length"] } {
STATS::incr "ContentType" "Other_len" [HTTP::payload length]
}
}
}
}
To view the results, I would then go to Statistics -> Local Traffic -> Profiles/Statistics
I have not yet pumped any traffic yet but I do see the zero counts.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
