Andy_Herrman_22
Jul 09, 2007Nimbostratus
Dynamic Pool Names
I'd like to be able to select which pool to use based on some data in the HTTP request, but I don't want to have to hard code the pools in the iRule. Is it possible to dynamically create the pool name (stored in a variable) and then select the pool using that?
The pool command seems to take the name as if it's a literal, not a variable, meaning you do:
pool my_pool1
instead of
pool "my_pool1"
Is it possible to use strings or variables as the pool name? For instance, could I do
something like:
when HTTP_REQUEST {
Pool number stored in pid query param
set poolID [findstr [HTTP:uri] "pid=" 4 "&"]
set poolName "my_pool$poolID"
pool $poolName
}
or maybe
when HTTP_REQUEST {
Pool number stored in pid query param
set poolID [findstr [HTTP:uri] "pid=" 4 "&"]
pool "my_pool$poolID"
}
(my code might not be quite right. I haven't written an iRule in about a year and my dev F5 box isn't working right now so I can't test it).