Switch Statement Routing to Separate VS Using 'Virtual'
Good afternoon,
I am trying to route traffic based upon a URI switch using -glob to a separate virtual server. I've read up on the 'virtual' command, and think I have the syntax right, but there's something wrong that I can't pinpoint. Wondering if anyone had any guidance as to what to try next?
iRule:
when HTTP_REQUEST {
set uri1 [string tolower [HTTP::uri]]
switch -glob $uri1 {
"/uriA*" -
"/uri1/uri2/v1*" {
log x.x.x.x local0.info "URI Var: $uri1"
log x.x.x.x local0.info "Routing to vs for api_stage_https"
virtual api_https
log x.x.x.x local0.info "VS: [virtual name]"
return
}
default {
pool app
}
}
}
The logs I get when hitting this is:
Dec 16 14:07:33 LTM tmm[9290]: Rule /Common/app_rule : URI Var: /uri1/uri2/v1/uri3 Dec 16 14:07:33 LTM tmm[9290]: Rule /Common/app_rule : Routing to vs for api_stage_https Dec 16 14:07:33 LTM tmm[9290]: Rule /Common/app_rule : VS: /Common/app_https
I also have log statements in the api_https virtual server but they never get triggered. If I manually go to the api_https virtual server with a direct link, it works fine. But within this logic it doesn't seem to work. Thoughts?
Also, we're running BIG-IP 11.4.0 Build 2425.0 Hotfix HF4 currently.
Ted