Rodney_Newton_7
Sep 21, 2006Nimbostratus
Pool selection using uri variables
I have a unit in test where test sites are added frequently so I am constantly adding pools to the bigip and using and iRule for pool selection similar to the following.
when HTTP_REQUEST {
if {[HTTP::uri] contains "test1"}
{pool testbed-test1}
elseif {[HTTP::uri] contains "test2"}
{pool testbed-test2}
elseif {[HTTP::uri] contains "test50"}
{pool testbed-test50}
else {pool defaultpool}
}
The uri hitting the vip looks like this... http://hostname/xx-test1, http://hostname/xx-test50, etc...
It would be nice if I could just add the new pool and not have to edit my iRule each time. Is there a way that I can parse the info from the uri into a variable then use that variable as part of the pool name in the selection statement? Keep in mind that the varaible portion of the pool name will be after the "xx-" in the uri and could be 4 or 5 characters in length. Thanks for any input.