Forum Discussion
Jason_Cohen_417
Aug 01, 2018Historic F5 Account
Marvin,
For the most part, getting an added command to look across other virtuals persist records without enabling persist across * is slim. There are probably too many dark corners around which that could / would break. The preferred mechanism to do this would be with the table commands.
A minimal framework using the table commands could look similar to this:
when RULE_INIT {
probably makes more sense to use data groups here
quick and dirty PoC
set static::web1_peer "/Common/vs_web2"
set static::web2_peer "/Common/vs_web1"
}
when LB_SELECTED {
table set [virtual name]:[IP::client_addr] [LB::server]
}
when HTTP_REQUEST {
if { [virtual] eq "/Common/vs_web1" } {
set peer ${static::web1_peer}
}
elseif { [virtual] eq "/Common/vs_web2" } {
set peer ${static::web2_peer}
}
set peer_persist [table lookup ${peer}:[IP::client_addr]]
if { ${peer_persist} ne "" } {
log local0. "${peer} persist-record: ${peer_persist}. Select and persist to partner memeber."
}
else {
log local0. "Peer persist-record not found. Making selection."
}
}