Forum Discussion
Mike_McCardle_1
Nimbostratus
Dec 19, 2006Basic iRule not working after upgrade
Hello All,
After an upgrade from 4.5.10 to 9.1.1, I cannot for the life of me get this iRule to work. it's pretty basic but for whatever reason, it doesn't want to work. I have a VS listeni...
Deb_Allen_18
Dec 19, 2006Historic F5 Account
You mentioned that you want to direct traffic if the URI "contains" that string, which may be the problem. Try using the "contains" or "starts_with" operator instead. You might also want to make the comparison case-insensitive, and a switch statement might be in order as well -- try one of these:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] contains "/jive" }{
pool Jive_Web
} elseif { [string tolower[HTTP::uri]] contains "/webnow" }{
pool WebNow
} else {
persist cookie insert wldevpool
pool Weblogic
}
}
or:when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
Adjust wildcards as necessary.
"/jive* is equivalent to "starts_with /jive"
"*jive* is equivalent to "contains jive"
"/jive*" {
pool Jive_Web
}
"/webnow*" {
pool WebNow
}
default {
persist cookie insert wldevpool
use pool Weblogic
}
}
}
HTH
/deb
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