Forum Discussion
djkromarek
Nimbostratus
Jan 28, 2015iRule to set pool based on URI then persist based on clientIP
I have the following iRule that based on the URI, sends the clientIP to a specific pool. Once they are in that pool, no matter what host or URI they go to, I need them to persist to that pool.
when H...
StephanManthey
Nacreous
Jan 28, 2015Hi djschul,
maybe this iRules in combination with slightly modified persistence settings and default pool set to pool_thispool helps to solve the requirement. Please use "source address affinity" as fallback persistence profile for your virtual server (perhaps with a modified timeout of 10,800 seconds).when HTTP_REQUEST {
set persist_record [persist lookup source_addr "[IP::client_addr] any virtual"]
log local0. "persist lookup: $persist_record"
if { $persist_record equals "" } {
if { [HTTP::host] matches_regex "abc.com" }{
if { [string tolower [HTTP::uri]] starts_with "/test" } {
pool pool_thispool
log local0.alert [HTTP::host]
} else {
pool pool_defaultpool
persist none
}
}
}
}
Thanks, Stephan
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects