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...
hoolio
Cirrostratus
Jun 17, 2008If it's not HTTP, and there are multiple payloads you want to collect, can you try this?
when CLIENT_ACCEPTED {
if { [TCP::local_port] == 80 } {
log local0. "accepted"
TCP::collect 100
}
}
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 pool_bookings] [expr {int(rand()*[active_members pool_bookings])}]]
set ip [lindex $cserver 0]
pool pool_bookings member $ip
persist none
TCP::release
TCP::collect
}
}
}
Aaron
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
