Forum Discussion
pjcampbell_7243
Cirrus
Apr 30, 2013Specifying pool in iRule failing
I have an iRule here and when I hit up the VIP that has this rule applied, it does not seem to work at all:
when CLIENT_ACCEPTED {
Save default pool name
set def...
Kevin_Stewart
Employee
Apr 30, 2013If I may interject with a few comments, to Steve's original statements, when used in CLIENT_ACCEPTED, the [LB::server pool] command returns the default pool of the VIP before it could have been changed by an iRule, HTTP class or other method. It's also good practice to use this structure when doing this kind of dynamic, real-time pool selection because pool selection is generally "sticky" within a TCP session. In other words, if multiple HTTP requests come through a single TCP session, a single pool statement will force all subsequent requests down that path. You might also be experiencing, as Nitass suggests, multiple requests for different objects within the page that don't meet your pool selection criteria.
Please try this modified version of your iRule and review/report the results:
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
log local0. "default pool = $default_pool"
}
when HTTP_REQUEST {
log local0. "uri = [string tolower [HTTP::uri]]"
if { [string tolower [HTTP::uri]] ends_with "test=64" }{
log local0. "first condition"
pool test-temp
} elseif { [string tolower [HTTP::uri]] contains "test=64&" }{
log local0. "second condition"
pool test-temp
} else {
log local0. "default condition"
pool $default_pool
}
}
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