Forum Discussion
Tony_Bourke_935
Nimbostratus
Sep 10, 2010iRules HTTP_RESPONSE based on Pool?
Is there a way to do switch or if statements based on the pool the response came from?
For example:
I'm dividing up traffic into two pools based on the URI. Pool "http" and pool "gopher".
I nee...
L4L7_53191
Nimbostratus
Sep 14, 2010Hi Tony: would it be possible to simply set a variable in your HTTP_REQUEST event that you reference on HTTP_RESPONSE? For example, you've already made a decision to send some traffic to one pool or the other based on uri, so you should be able to do this.
Here's some non-tested, free form code as an example.
when HTTP_REQUEST {
if {HTTP::uri equals '/foo'} {
set selected 'gopher'
pool gopher
} else {
set selected 'http'
pool http
}
}
when HTTP_RESPONSE {
log local0. "This response is coming from pool $selected..."
}
I'm sure I've got a fat-finger or two in here but hopefully it'll give you an idea of what I am thinking here.
-Matt
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
