The builtin TCL "string tolower" command should do what you want.
when HTTP_REQUEST {
set uri [string tolower [HTTP::uri]]
if { $uri contains "/crn" } {
pool pdam.com-HTTP
} elseif { $uri contains "/dmz0431993" } {
pool www.domain.com-8683
} elseif { $uri contains "/dmz0431994" } {
pool www.domain.com-8683_appserv2
}
}
A couple of comments on your iRule.
If you are using the contains operator, then any string match within the URI will get picked up regarless of if it's the first on (ie. /crn, /foo/crn). From your example, it's implied, that you are comparing the first part of the URI. If so, you might want to use the "starts_with" operator in place of "contains".
Also, here's an alternate approach to your iRule using a switch statement (switch statements are a touch faster than if/elseifs.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/crn*" {
pool pdam.com-HTTP
}
"/dmz0431993*" {
pool www.domain.com-8683
}
"/dmz0431994*" {
pool www.domain.com-8683_appserv2
}
}
This is analogous to your previous iRule with the "starts_with" operator. If you want to make it like a "contains" comparison, just prepend each string match with another "*".
Probably more info than you wanted, but oh well, it's Monday...
-Joe