Forum Discussion
AaronB_8424
Jun 04, 2008Historic F5 Account
Please review this iRule
Can somebody tell me why this iRule might not work properly? We are seeing urls that should match an else statement go to a different pool (not necessarily the fallback pool). Sometimes things work, s...
The_Bhattman
Nimbostratus
Jun 04, 2008There is allot of IF-ELSEIF statements. It maybe more efficient to use the switch statement
For example
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"*/securemail*" { HTTP::redirect "https://someotherdomain.com/messenger/" }
"*/test/*" { pool pilotweb }
"/raersWeb*" { pool Reporting_Production }
"*"/teleform/*" { pool reporting }
.
.
.
DEFAULT {
set uri [HTTP::uri]
set UA [HTTP::header "User-Agent"]
log local0. "lb fallthrough: $uri browser $UA"
pool oracleweb
}
}
}
Click here and/or Click here for more indepth view of using the "switch" command
Also if you have a default pool already assigned to the virtual address it will mean if non of these matches it basically picks the pool.
Hope this helps
CB
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