Forum Discussion
yuni
Jul 16, 2019Altostratus
iRule syntax error
Hello Could you please help me correcting my following iRule? I am newbie to iRules, so I couldn't figure out the error. when HTTP_REQUEST {
switch -exact -- [HTTP::uri] contains "/info/c...
- Jul 16, 2019
You're syntax is slightly off, try this
when HTTP_REQUEST { switch [HTTP::uri] { "/info/capacity" { if {[active_members pool_test1 ] >0 } { pool pool_test1 } else { pool pool_sorry } } "/execution/v1" { if {[active_members pool_test2 ] >0 } { pool pool_test2 } else { pool pool_sorry2 } } } }
Lee_Sutcliffe
Jul 16, 2019Nacreous
You're syntax is slightly off, try this
when HTTP_REQUEST {
switch [HTTP::uri] {
"/info/capacity" {
if {[active_members pool_test1 ] >0 } {
pool pool_test1
} else {
pool pool_sorry
}
}
"/execution/v1" {
if {[active_members pool_test2 ] >0 } {
pool pool_test2
} else {
pool pool_sorry2
}
}
}
}
- yuniJul 17, 2019Altostratus
Thank you so much, Lee Sutcliffe
It works well!!
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