Forum Discussion
Richard_Kim_270
Nimbostratus
Jan 11, 2007iRule for starts with "reports/" data group?
I'm looking for an iRule that will redirect the request to a pool if the URL contains a "/reports/* in the URL path. Currently I am using:
when HTTP_REQUEST {
if { [matchclass [...
Jan 11, 2007
Yes, the "strings tolower" built-in TCL command will convert the string to lower case. So, if you "string tolower" the HTTP::uri you will want all your strings in your Report_Strings data group to be lower case.
But if all you want to do is to match all uri's that start with "/reports/" then why don't you just use a simple string comparison with the starts_with operator?
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/reports/" } {
pool RP_pool_1
}
}-or- you could use a switch statement and string globbing
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/reports/*" {
pool RP_pool_1
}
}
}-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
