Forum Discussion
Eduardo_Saito_1
Nimbostratus
Jan 09, 2009Modifying HTTP REQUEST DATA
Hello guys.
Every iRule I've made that need to access HTTP_RESPONSE_DATA I used the following code:
when HTTP_REQUEST {
No Chunk
if { [HTTP::versi...
Eduardo_Saito_1
Nimbostratus
Jan 09, 2009Thanks for the reply hoolio.
The only irule error I see is this one, but I have only this single entry in ltm log and he customer made several attempts.
irule_log - Illegal argument (line 25) invoked from within "HTTP::collect $clen"
The title is wrong I'm not modifying the HTTP Payload actually I'm using HTTP::payload for logging and statistics. Sorry about this.
Do you think HTTP::version part is correct even though I'm interested only in the HTTP_REQUEST_DATA?
Regarding logging TCP resets from this client I've made this iRule but I need to put it on a test environment.
when CLIENT_ACCEPTED {
if { [IP::addr [IP::client_addr] equals 200.200.200.200] } {
log local0. "Just the client I want to debug: 200.200.200.200."
set debug 1
}
}
when HTTP_REQUEST {
No Chunk
if { [HTTP::version] eq "1.1" } {
if { [HTTP::header is_keepalive] } {
HTTP::header replace "Connection" "Keep-Alive"
}
HTTP::version "1.0"
}
Colect Content_length
set clen [HTTP::header Content-Length]
if { not [info exists clen] or "" eq $clen } {
set clen 1000000000
}
HTTP::collect $clen
}
when HTTP_REQUEST_DATA {
if { $debug == 1 }{
log local0. "Here comes the HTTP REQUEST PAYLOAD for 200.200.200.200..."
log local0. "[HTTP::payload]"
}
HTTP::release
}
when HTTP_RESPONSE {
if { [HTTP::header exists "Content-Length"] } {
set content_length [HTTP::header "Content-Length"]
} else {
set content_length 1000000000
}
HTTP::collect $content_length
}
when HTTP_RESPONSE_DATA {
if { $debug == 1 }{
log local0/ "Here comes the HTTP RESPONSE PAYLOAD for 200.200.200.200..."
log local0. "[HTTP::payload]"
}
HTTP::release
}
when CLIENT_CLOSED {
if { $debug == 1 }{
log local0. "Client 200.200.200.200 getting disconnected..."
}
}
Thanks again!
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