Forum Discussion
Jack_39703
Nimbostratus
Jul 27, 2009contains? starts_with? equals?
hi there
i have a existing iRule as follow
when HTTP_REQUEST {
if { [HTTP::uri] contains "/123/"} {
pool 123
}
elseif { [HTTP::uri] s...
Jul 27, 2009
If for some reason "equals" isn't working for you, you might want to try a switch command with glob matching.
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"*/123/*" {
pool 123
}
"/456/*" {
pool 456
}
default {
pool 789
}
}
}
Make sure you don't have case comparison issues (ie. "/A" won't match "/a"). If you need mixed case, enclose the HTTP::uri with a "string tolower".
And, if all else fails, throw in some log statements to help diagnose why your matches aren't succeeding. Could be there are some trailing GET variables in the URI that you aren't accounting for.
-Joe
-Joe
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
