Forum Discussion
JCMATTOS_41723
Nimbostratus
Aug 08, 2013Combining Swtich iRules for HTTP::uri and HTTP::cookie?
We have version 11.1 and trying to create a new application workflow process by combining the current switch irules into one. We currently have an HTTP::uri and HTTP::cookie irules working separately...
Kevin_Stewart
Employee
Aug 09, 2013Well, you definitely want an OR structure, but honestly I think an if/elseif would be a better choice here. You only have 2 conditions and a switch context would require nesting another switch in the default condition of the parent switch, and then another switch nested in the default condition of that switch. Generally speaking, a switch is faster when you're comparing large sets of values, compared to an if/elseif, but with only 2 conditions I think you'd be hard pressed to see a difference in performance.
if { [string tolower [HTTP::uri]] contains "/application/" } {
pool this_pool
} elseif { [HTTP::cookie exists foo-cookie] } {
pool that_pool
} else {
pool default_pool
}
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