Sake_Blok
Mar 14, 2005Nimbostratus
iRule not using default pool
Hi,
I build an iRule that chooses a node, based on a server-id cookie. In the rule I check whether the cookie is present, if not, the rule defaults to the configured pool. If the cookie is present, it uses findclass to select a node. It all works fine, up until there is a request with the cookie, but with an unknown value. I would expect the iRule to fall back to the default pool, but instead it terminates the session with a TCP-RST. To make it use the default pool, I had to add the pool command, but that makes this rule less general.
Can anyone tell me why the iRule terminates the session instead of use the configured pool when the cookie was found and it's value was not found in the class?
Cheers, Sake
Here is the relevant config:
class nodes_testlab {
"web-s01 192.168.103.1:80"
"web-s02 192.168.103.2:80"
}
pool testlab {
monitor all http
member 192.168.103.1:http
member 192.168.103.2:http
}
rule cookie_lbsid {
when HTTP_REQUEST {
if { [HTTP::cookie exists "lbsid"] } {
set tmp [findclass [HTTP::cookie "lbsid"] $::nodes_testlab " "]
if { $tmp ne "" } {
log local0. $tmp
node $tmp
} else {
log local0. "Not a valid cookie-value!"
pool testlab <--- I'd like to remove this statement!
}
}
}
}
virtual test-vip {
destination 192.168.100.200:http
ip protocol tcp
profile http tcp
pool testlab
rule cookie_lbsid
}