Forum Discussion
Can I add active member check to pool switch iRule?
Hello all, I have a request from a user where they would like a URI redirection to a separate 3rd host. The current pool has 2 hosts. The condition is if it matches the URI redirection, but the 3rd host is down, then go back to the original pool of 2 hosts. Is that possible? So far my iRule looks like this but I cannot figure out the 2nd requirement they need. Any help is appreciated. If there is a better way to do this otherwise, please let me know. Thanks!
ltm rule myrule {
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/myuri/abc*" { pool myuri_pool }
default { pool my-default-pool }
}
} }
2 Replies
- Faruk_AYDIN
Altostratus
Yes, It is possible. Change your iRule like this way:
when HTTP_REQUEST { switch -glob [HTTP::uri] { "/myuri/abc*" { if { [active_members myuri_pool] > 0 } { pool myuri_pool } else { pool my-default-pool } } default { pool my-default-pool } } }
- jmusci_327228
Nimbostratus
May i ask which version are you using ? I tried this rule and sintax but i had some problem with the "switch -glob" command. I don't need "active_members" or "default-pool", it should be easier
Recent Discussions
Related Content
* 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