Forum Discussion
Brian_69413
Jun 14, 2012Nimbostratus
Default pool in a switch statement
We have a Virtual Server that is assigned a default pool and also an iRule that applies a different pool given a certain path. We believe this was working fine as an if statement, but was recently changed to a switch statement. We started to receive reports that traffic not matching one of the cases(I.e. hitting the default). We're still ending up at the secondary pool. A pool statement in the default case fixed this, but was wondering why this would be necessary. Also, is it different from an IF statement, or was it just a coincidence?
I assumed that these non-matching cases would look to the VIP config for pool info.
- hooleylistCirrostratusHi Brian,
when CLIENT_ACCEPTED { set default_pool [LB::server pool] } when HTTP_REQUEST { switch -glob [HTTP::path] { "/app1*" { pool pool_app1 } "/app2*" { pool pool_app2 } default { pool $default_pool } } }
- Brian_69413NimbostratusThanks, that is helpful info. The reason I was down this path is because one case has a redirect, one just changes the path and the other assigns a new pool. I will take your advice and modify all cases to include the default pool.
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