Jason_130176
Oct 14, 2014Nimbostratus
URL persitance iRule using UIE
I am tring to write an iRule to hash the hostname with CRC and persist all connetions for a specific URL hostname to one server, I am unable to add the uie add command in the HTTP_REQUEST context.
Is there another way to do this?
when HTTP_REQUEST {
set FQDN hash persistance
set host [string tolower [HTTP::host]]
set hash [crc32 "$host"]
set mod [expr $hash % 6]
log local0. "Matching $mod in datagroup"
if {[persist lookup uie $mod] equals ""} {
persist uie [$mod]
} else {
log local0. "UIE already exists for $mod"
}
log local0. "Matching [IP::client_addr] on $mod"
}