Forum Discussion
Craig_Freyman_1
Nimbostratus
Feb 09, 2006Gathering Statistics
We're trying to find a way to gather information about what version of HTTP people's browsers are using on a site of ours.
We've started with this irule:
when HTTP_REQUEST {
if {([HTTP::version] == "1.0") or ([HTTP::version] == "0.9")} {
HTTP::....would be nice to post this data somewhere!
}
}
Can we shoot this information somewhere so we can look at it later?
- Colin_Walker_12Historic F5 AccountWell, you can certainly log it...
when HTTP_REQUEST { if {([HTTP::version] == "1.0") or ([HTTP::version] == "0.9")} { log local0. "HTTP version is [HTTP::version]" } }
- Other options for storing data would be in global variables, lists, or arrays and then build an iRule that will use HTTP::respond to return the formatted results. Or you could try out the new "stats" profile introduced in 9.2. Here you can create your own statistics and fill the values from within the iRule.
- rapmaster_c_127Historic F5 AccountTaking a step back though, if you just want to track status codes and request versions, there's no need for an irule.
b http
- Craig_Freyman_1
Nimbostratus
Thanks for the replies. - Colin_Walker_12Historic F5 AccountInteresting. Perhaps you could add another check in your if to work around this?
when RULE_INIT { set count 0 } when HTTP_REQUEST { incr count if { $count == 1 } { if {([HTTP::version] == "1.0") or ([HTTP::version] == "0.9") } { log local0. "HTTP version is [HTTP::version]" } } } when CLIENT_CLOSED { set count 0 }
- rapmaster_c_127Historic F5 AccountOr just pick one object on the page to log stats on, and don't log if the client is presenting an "If-Modified-Since" header in order to catch re-visitors.
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