Forum Discussion
Craig_Hammer_10
Nimbostratus
Jul 21, 2005Failing to match URI in SWITCH statment
When using this rule, I never seem to match the first two evaluation steps:
when HTTP_REQUEST {
switch { [HTTP::uri] starts_with } {
"/argo/tcc" {
use pool one
}
"/argo/tc-update" {
use pool two
}
default {
use pool three
}
}
}
Every request falls through to the default pool, and recevie this from the servers in the default pool: HTTP Status 404 - /argo/tc-update
From the 404, I know the URI is coming through like I expect it to, but I can not see why it does not match the first statement.
Any ideas?
- unRuleY_95363Historic F5 AccountI don't believe you want the "starts_with" operator as part of the switch. You probably want something more like this:
when HTTP_REQUEST { switch -glob [HTTP::uri] { "/argo/tcc*" { use pool one } "/argo/tc-update*" { use pool two } default { use pool three } } }
- Craig_Hammer_10
Nimbostratus
unRuleY, - unRuleY_95363Historic F5 AccountHmm, that's a good question.
- JRahm
Admin
These are the discussions that are most helpful to me. Code efficiency would be a helpful addition under the docs and tips section. As rules developed here on DevCentral reveal keen insight into the depths of iRules coding the threads could be repackaged as a collection of brief tutorials.
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