Forum Discussion
Movva_110216
Nimbostratus
Apr 07, 2011http_request payload logging is not full
Hi Experts,
I have the below simple irule
when HTTP_RESPONSE {
if {[HTTP::header value Content-Type] contains "application/vnd.syncml+xml"}
{ log local0. " [clock forma...
hoolio
Cirrostratus
Apr 07, 2011Hi Ravi,
The HTTP_RESPOND event is triggered once TMM has collected enough packets to get the last HTTP header. If you call [HTTP::payload] in HTTP_RESPONSE, it will only return the HTTP payload available in the packet(s) required to parse all of the HTTP headers. If you want to collect the full HTTP payload, you'll need to use HTTP::collect:
http://devcentral.f5.com/wiki/default.aspx/iRules/http__collect
when HTTP_RESPONSE {
Trigger collection for up to 1MB of data
if {[HTTP::header exists "Content-Length"] && [HTTP::header "Content-Length"] <= 1048576}{
set content_length [HTTP::header "Content-Length"]
} else {
set content_length 1048576
}
Check if $content_length has been set and is not set to 0
if { $content_length > 0} {
HTTP::collect $content_length
}
}
when HTTP_RESPONSE_DATA {
do stuff with the payload
set payload [HTTP::payload]
}
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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