Forum Discussion
prax_73377
Mar 18, 2011Nimbostratus
Routing based on value of cookie
Hi Gurus, Need some help with iRules, I am oracle applications dba and do not know much about the iRule thing in F5. We have 4 web server nodes and I defined 4 pools one ser...
hooleylist
Mar 18, 2011Cirrostratus
Can you try this? Make sure to use a OneConnect profile (with a /0 source mask if you're using SNAT or /32 with no SNAT).
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
log local0. "Cookie: [HTTP::cookie value "OracleCookie"]"
Try to select a pool based on the http cookie containing pool information
if { [HTTP::cookie value "OracleCookie"] ne "" }{
switch [HTTP::cookie value "OracleCookie"] {
"OraA" {
pool Pool-A
log local0. "Using INTB-Pool-A"
}
"OraB" {
pool Pool-B
log local0. "Using INTB-Pool-B"
}
"OraC" {
pool Pool-C
log local0. "Using INTB-Pool-C"
}
"OraD" {
pool Pool-D
log local0. "Using INTB-Pool-D"
}
default {
pool $default_pool
log local0. "Using $default_pool"
}
}
}
}
Aaron
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