Hi,
your "new" irule is not working.
The condition must be:
([string tolower [HTTP::header User-Agent]] contains "msie7") or ([string tolower [HTTP::header User-Agent]] contains "msie8")
And you can optimize the irule like that:
when RULE_INIT {
array set static::pools {
0 "www.hector.com_cluster_2a"
1 "www.hector.com_cluster_2b"
2 "www.hector.com_cluster_2c"
}
}
when HTTP_REQUEST {
if { ([string tolower [HTTP::header User-Agent]] contains "msie7") or ([string tolower [HTTP::header User-Agent]] contains "msie8") } {
pool www.hector.com_cluster_2k
} elseif { [info exists static::pools([HTTP::cookie hectorlbhkg])]} {
pool $static::pools([HTTP::cookie hectorlbhkg])
} else {
set PoolID [expr { int(rand()*[array size static::pools])}]
while { [info exists static::pools($PoolID)] } {
log local0. $PoolID
if { ([active_members $static::pools($PoolID)] >= 3) } {
pool $static::pools($PoolID)
set selected $static::pools($PoolID)
break
} else {incr PoolID}
}
}
}
when HTTP_RESPONSE {
if {[info exists selected]}{
HTTP::cookie insert name hectorlbhkg value $selected path "/"
}
}
The random value is an integer between 0 and the size of the static array. Adding a new entry in the array will apply without any change in the irule.