Forum Discussion
ML_108504
Apr 15, 2009Nimbostratus
OK, we tested our iRule using curl from a handful of individual hosts. The iRule did exactly what we wanted it to do: sent all http requests with bot user-agent strings to our botfarm and all other connections to the default pool.
We tried using both the 'return' and 'event disable' statements and saw no difference between them, although since the 'event disable' should only be triggering for connections not matching the bots data group, the evidence may have slipped past us.
If it were possible to cajole this iRule into only executing once per connection (rather than once per http request) for bots, that'd be ideal (and maybe fantasy).
In any case, we're rolling on this pretty well right now. We didn't see any adverse impact to leaving out an explicit lb::server command, if anyone can speak more about that concern, please do!
Thanks to everyone who chimed in here!
when HTTP_REQUEST {
if { [matchclass [string tolower [HTTP::header User-Agent]] contains $::bots] } {
if { [active_members p_PUB_botfarm] > 0 } {
pool p_PUB_botfarm
} else {
event disable
}
}
}
EDIT: Aaron, can you suggest a convenient way to validate the behavior you suspect with using 'event disable' here? Cheers!