Forum Discussion
Kris__109062
Nimbostratus
Oct 31, 2008iRule to Select alternate pool member based on QUERY_STRING
Hi,
I have the following iRule setup (define_node) which allows me to force a pool member to be selected if I add ?node=01 , ?node=02 & ?node=03 to the query string..
Now...
hwidjaja_37598
Altostratus
Oct 31, 2008Try this out:
when HTTP_REQUEST {
set persistTo [session lookup \
source_addr [IP::client_addr]]
set default_pool [LB::server pool]
set timeOut 3600
switch [ findstr [string tolower \
[HTTP::uri]] "node=" 5 2] {
01 { set persistTo 192.168.49.97 }
02 { set persistTo 192.168.49.98 }
03 { set persistTo 192.168.49.99 }
}
if {$persistTo eq ""} {
pool $default_pool
} else {
pool $default_pool member $persistTo
session add source_addr [IP::client_addr] \
$persistTo $timeOut
}
}
Hope it helps.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects