F5 iRule for persistence with header and source address persistence as fallback
Hello,
I'm not so good in iRules, but maybe someone can give me some examples, I have an VS for more than one service with an iRule like this below
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] starts_with "company.com"}{
if {[string tolower [HTTP::uri]] starts_with "/human"}{
pool "pool_human"
} elseif {[string tolower [HTTP::uri]] starts_with "/body"}{
pool "pool_body"
} elseif {[string tolower [HTTP::uri]] starts_with "/dev"}{
pool "pool_dev"
}
}
}
so now I want to integrate in this iRule a decision, for the /body should be an header persistence active, for example the request arrives with header1 it should persist to node1 in the pool_body and with header2 it should persist to node2 in the pool_body. If is header 1 and 2 not present he should use source address persistence as fallback persistence. Is that possible ? Could someone show me an example how could I the existing iRule extend with my requirement ?
thx
kind regards