Forum Discussion
Traffic stats - file size missing for chunk downloads
Dear experts.
We have the following iRule that is gathering traffic statistics. The data is being sent to our syslog server.
Recently our developers made a change that splits all files that are downloaded from the web server into chunks. Since the change we are not getting correct starts., iRule is not able to report file size anymore. Shouldn't it be able to track at least chunk sizes?
Will you be able to advise a change that should be made to the iRule so that it tracks chunk sizes and if it's possible summs their sizes and reports multiple chunk downloads correctly as a single file download?
From: W3C Extended Log File Examples (IIS 6.0)
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/ffdd7079-47be-4277-921f-7a3a6e610dcb.mspx?mfr=true
Fields: date time c-ip cs-username s-ip cs-method cs-uri-stem cs-uri-query sc-status sc-bytes cs-bytes time-taken cs-version cs(User-Agent) cs(Cookie) cs(Referrer)
when CLIENT_ACCEPTED {
Open a new high speed logging connection to the syslog pool named syslog_server_pool
set hsl [HSL::open -proto UDP -pool syslog_server_pool]
}
when HTTP_REQUEST priority 999 {
Save request variables that are not accessible in HTTP_RESPONSE, like the URI, request method, etc
set cs_uri_stem [HTTP::path]
set cs_uri_query [HTTP::query]
set ua [HTTP::header User-Agent]
set referer [HTTP::header Referer]
set method [HTTP::method]
set host_header [HTTP::host]
set http_request_time [clock clicks -milliseconds]
}
when HTTP_RESPONSE {
Send the syslog message with a syslog facility of 150 (local2.Informational)
See the HSL wiki page for details on the facilties:
http://devcentral.f5.com/wiki/iRules.HSL__send.ashx
set http_response_duration [expr [clock clicks -milliseconds] - $http_request_time]
HSL::send $hsl "[string map [list "\t\t\t\t" "\t\t-\t\t"] "<150>\t\t[IP::server_addr]\t\t[clock seconds]\t\t[IP::client_addr]\t\t$method\t\t$host_header\t\t$cs_uri_stem\t\t[HTTP::header Content-Length]\t\t[HTTP::status]\t\t\"$ua\"\t\t\"$referer\"\t\t$http_response_duration"]"
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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