Forum Discussion
Kevin_Stewart
Aug 08, 2013Employee
If I understand what you're doing, it looks like you're attempting to use a switch command as a condition to a higher switch command, which wouldn't work. You can nest switches if you put the internal conditionals INSIDE the action of a specific condition:
Example:
switch test1 {
"test1_condition1" {
switch test2 {
test2_condition1 {...}
}
}
}
So if you're trying to say "if a URI equals something -OR- a cookie equals something, then I think you really need to first pick the most important one and refactor them:
Example:
when HTTP_REQUEST {
switch - glob [string tolower [HTTP::uri]] {
"*/application/*" {
pool QA-POOLA-80
}
default {
switch -glob [HTTP::cookie "UserInfo"] {
"*COMPANYID=GC*" {
pool QA-POOLB-80
}
}
}
}
}