Forum Discussion
ouch_32572
Nimbostratus
Mar 19, 2009irule to rewrite steam in request
Hi All,
I have an issue that i have manged to resolve on another Lb (zxtm)
I need help translating my rule into an irule for f5.
how do i rewite the stream on an incomming requ...
hoolio
Cirrostratus
Mar 20, 2009Hi,
You may want to only enable the stream profile if the request is a POST with a content-length value greater than 0:
when HTTP_REQUEST {
Check if request is a POST and Content-Length header is > 0
if {[HTTP::method eq "POST" && \
[HTTP::header exists "Content-Length"] and [HTTP::header "Content-Length"] > 0}{
Set the stream find/replace
STREAM::expression "@https://10.104.30.55@http://10.104.30.55@"
Enable the stream filter for this request only
STREAM::enable
} else {
Disable the stream filter by default
STREAM::disable
}
}
when HTTP_RESPONSE
Disable the stream filter for the response
STREAM::disable
}
Make sure you add a blank stream profile to the virtual server and create a custom HTTP profile with response chunking set to rechunk. I think you may also want to disable the stream filter for the response so it's not applied to the response payload.
You can check the STREAM::expression wiki page (Click here) for details on the command.
You could also add code to log the match in the STREAM_MATCHED event (Click here) when debugging the iRule.
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
