Forum Discussion
Brian_Ott_11267
Nimbostratus
Dec 06, 2004http::payload
Can I use http:payload to evaluate the data sent to the client and then cause an action?
Such as, the client is sent a busy page, but instead of being sent the busy page the f5 box catches that it is a busy page and resends the request to another server in the pool.
such as:
when HTTP_REQUEST {
if {[HTTP::payload] contains "busy.gif"} {
}
}
I imagine its not that easy, since this isn't quite working. I am not familar with what http::payload returns, so I am not sure what to check for, nor if HTTP_REQUEST is the right action to trigger on.
Any information or help would be appreciated.
-Brian.
- bl0ndie_127134Historic F5 AccountWith iRules you can inspect both the content and the status code to determine if you need to re-write the response to the client.
when HTTP_RESPONSE { if {[HTTP::status] >= 500} { HTTP::redirect “http://www.sorry-server.com” } }
- Brian_Ott_11267
Nimbostratus
I can look into whether we can do that, but can you perhaps give me a sample of how to look at the content? - bl0ndie_127134Historic F5 AccountHere is an example for inspecting the content.
when HTTP_RESPONSE { Collect data for inspection set clen [HTTP::header Content-Length] if {$clen > 0} { HTTP::collect $clen } } when HTTP_RESPONSE_DATA { Check for ‘sorry’ data in the payload set found [string first “sorry.gif” [HTTP::payload $clen] ] Redirect if {$found != -1 } { HTTP::redirect “http://www.sorry-server.com” } }
- Brian_Ott_11267
Nimbostratus
Thank you!
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