Forum Discussion
Russell_E_Glaue
Nimbostratus
Feb 18, 2009How to disable iRule processing on keep-alive per request when using HTTP::respond
How to disable iRule processing on keep-alive per request when using HTTP::respond
Okay, I have encountered a problem I cannot figure out how to get around.
Here ...
spark_86682
Feb 19, 2009Historic F5 Account
Two things. First, I got this working using HTTP classes, but it was slightly different than I thought. My idea was also to get another event firing between two HTTP_REQUEST events, but there aren't any that occur naturally, so you have to induce one. There are a couple choices, like the NAME or AUTH stuff, but HTTP_CLASS_SELECTED sounded easiest. The problem is that if you do an HTTP::respond in HTTP_REQUEST, then HTTP_CLASS_SELECTED never fires. But you can do:
rule rule_one {
when HTTP_REQUEST {
set do_response 0
set condition 1
if { $condition } {
log local0. "Rule one, enabling response"
set do_response 1
event HTTP_REQUEST disable
}
}
}
rule rule_two {
when HTTP_REQUEST {
log local0. "Rule two, firing HTTP_REQUEST"
}
}
rule rule_respond {
when HTTP_CLASS_SELECTED {
log local0. "Got class match!"
if { $do_response } {
HTTP::respond 200 content { xyzabc123 }
event HTTP_REQUEST enable
}
}
}
virtual http_vip {
pool http_pool
destination 10.1.1.1:http
ip protocol tcp
rules {
rule_one
rule_two
rule_respond
}
httpclass httpclass
profiles {
http {}
tcp {}
}
}
In my tests, this will do the HTTP::respond and keep the connection open and the HTTP_REQUEST in rule_two will never fire. Obviously, you'll want something more complicated than "set condition 1" ;-).
On another note, while I understand "event [foo] end", and quite like the idea, what are you suggesting "event [foo] end all" to do? Skip all events for the remainder of the connection? Please keep in mind that "event" is a very general command that needs to apply to all the protocols that BIG-IP does or will handle, and is not limited to request/response protocols like HTTP, so "skip all events for the remainder of this request" is probably an unuseful concept.
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