Forum Discussion
Cody_Conklin_17
Nimbostratus
Aug 11, 2005iRule variable match is case sensitive
I have an iRule that behaves normally:
if (http_uri starts_with "/authentication") {
use pool IIS_Pool_80
}
else if (http_uri starts_with "/certapp") {
use pool IIS...
Martin_Machacek
Aug 11, 2005Historic F5 Account
The "tolower" function converts a string to lowercase, it does not make string match case insensitive.
Correct syntax is:
if (tolower(http_uri) starts_with "/authentication") {
use pool IIS_Pool_80
} else {
use pool beta.pmi.org
}BTW, the best way how to match one of several strings is to use a class and the "one of" operator. It is more efficient than several string match experssions ORed and also more efficient than a chain of if-else statements. One of your previous rule examples could be rewritten like this:
class allowed_uris {
"/certapp"
"/authentication"
"/lms"
}
rule r1 {
if(tolower(http_uri) starts_with one of allowed_uris) {
use pool IIS_Pool_80
} else {
use pool beta.pmi.org
}
}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
