F5 irule getfield to split url and pass to different pools
Hi All
I am using the getfield to split a url and see if I can get the traffic to a different pool. The challenge I have is that /test/// needs to be served from a different pool from the default and anything else need to be served from the default pool (i.e. /test/*//).
I have tried the below but I am seeing all request are being served from the TESTPOOL
when HTTP_REQUEST { set level3 [getfield [HTTP::uri] "/" 3] set level4 [getfield [HTTP::uri] "/" 4] set level4 [getfield [HTTP::uri] "/" 5]
if {[string tolower [HTTP::uri]] starts_with "/test/" && ([string tolower [HTTP::uri]] contains "$level5") }{ } elseif {[string tolower [HTTP::uri]] starts_with "/test/" && ([string tolower [HTTP::uri]] contains "$level3") &&! ([string tolower [HTTP::uri]] contains "$level5") }{ pool TESTPOOL } } }
Any pointers or a better approach much appreciated