gpayne_144568
Sep 29, 2014Nimbostratus
Switch Irule
I need to create an IRULE that takes a certain uri and redirects based on the start to specific pools. Would like to do this in switch format.
Any suggestions.
Ok here is what I have. It is very ineffecient and I want to change it to work. I know I could do and if/elseif to clean it up. Would prefer to do switch with the log statement.
Change debug to 1 to enable logging
when HTTP_REQUEST { set static::DEBUG 0
if {[string tolower [HTTP::path]] starts_with "/XXXX"}{ pool XXX---xxxx-x-xxxxx.xxxx.xxxx.xxx---POOL---8095 } if {[string tolower [HTTP::path]] starts_with "/xxx/xxxx"}{ pool XXX---xxxx-x-xxxxx.xxxx.xxxx.xxx---POOL---8095 } if {[string tolower [HTTP::path]] starts_with "/xxx/xxxx"}{ pool XXX---xxxx-x-xxxxx.xxxx.xxxx.xxx---POOL---8095 } if {[string tolower [HTTP::path]] starts_with "/xxx/xxxx"}{ pool XXX---xxxx-x-xxxxx.xxxx.xxxx.xxx---POOL---8095 if { $static::DEBUG != 0 } { log local0. "for [IP::client_addr] Pool was selected and directed to port 8095" } } }