Forum Discussion
Kris__109062
Nimbostratus
Jun 16, 2008Odd results with iRule on virtual server selecting random pool member
Hi,
I have the following iRule setup on a Virtual Server of Type "Standard" using the "TCP" profile which has a custom Source Address Affinity persistence profile with a timeout of 1800...
Kris__109062
Nimbostratus
Jun 17, 2008Hi,
Thanks for the tip on getting the default pool for a virtual server.
I managed to sort this issue out by using a smaller byte parameter (50 bytes not 100 bytes) with TCP:collect
when CLIENT_ACCEPTED {
if { [TCP::local_port] == 80 } {
set default_pool [LB::server pool]
TCP::collect 50
}
}
when CLIENT_DATA {
if { [ findstr [TCP::payload] "rand=" 5 4] equals true} {
set daStr [ findstr [TCP::payload] "rand=" 5 4]
log local0. "rand= found"
if { $daStr equals "true" } {
set cserver [lindex [active_members -list $default_pool] [expr {int(rand()*[active_members $default_pool])}]]
set ip [lindex $cserver 0]
pool $default_pool member $ip
persist none
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
