Forum Discussion
Brian_Kenworthy
Nimbostratus
Oct 03, 2006Inspect URI without Case Senstivity?
Hello all,
I have created the following rule to redirect traffic based on the URI to another pool, however, I want the rule to ignore case sensitvity within the URI string. Here is my rule:...
Oct 03, 2006
I prefer the switch statement myself (or a data group in combination with the matchclass command if you have a lot more strings to match.
Here's how the switch statement would look:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/_xml/ors/status.asp*" -
"/_xml/vendor/status.asp*" -
"_xml/client/status.asp*" {
POOL mypool_B2B_SSL
}
default {
pool mypool.com_SSL
}
}
}
The -glob makes the switch perform like unix file globbing (wildcarding). This is much less expensive CPU-wise than a regular expresion check and gives you the flexibility to use wildcards in your comparisons. Note that I put a "*" at the end of the strings making it equivalent to a "starts_with" comparison.
-Joe
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