Forum Discussion
RACQ_74493
Cirrus
Jan 04, 2011post about how to modify default pool behaviour
Hello,
I found a post on an irule to to send traffic to different pool based on URL and it also discussed how to change the behaviour of the default pool and I cannot find it.
I have an...
Colin_Walker_12
Jan 05, 2011Historic F5 Account
Okay, to answer some of the questions:
If you don't want traffic going to a default pool, just make sure the default action in your logic case (switch, if/else, whatever) is to drop, and you'll never get things sent to the default pool. The only time the default pool is used is when there is no explicit balancing decision made within the iRule.
Yes, switch matches from the top down.
Yes, there is a better way, assuming you are going to end up with LOTS of matches. If you put these into a class you can write the logic once, and expand the class as needed with new URI/pool pairs without ever modifying the code.
It'd look something like this:
when HTTP_REQUEST {
set myPool ""
set myPool [class search -value myClass starts_with [string tolower [HTTP::path]]]
if {$myPool ne ""}
pool $myPool
} else {
drop
}
}
With a class that looks like:
class myClass {
"/apps/applytojoin" := "lpl_site1_https_applytojoin"
"/apps/applytonotjoin" := "lpl_site1_https_applytonotjoin"
...
etc.
This way as you get new path/pool combos, you just add them to the class and the logic stays the same. Make sense?
Colin
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