Forum Discussion
boneyard
Jul 19, 2016MVP
in general you are right, there are some syntax issues with your code though, did you try it in the irule editor on the big-ip at all?
this works for me:
if { ( [TCP::local_port] == 15672 ) or ( [TCP::local_port] == 4369 ) or ( [TCP::local_port] == 25672 ) or ( [TCP::local_port] == 5672 ) or ( [TCP::local_port] == 61613 ) or ( [TCP::local_port] == 61614 ) or ( [TCP::local_port] == 1883 ) or ( [TCP::local_port] == 8834 ) } {
pool poola
} elseif { ( [TCP::local_port] == 22) } {
pool poolb
}
`
still something with switch instead of if is probably cleaner and more readable
`switch [TCP::local_port] {
"1883" -
"4369" -
"5672" -
"8834" -
"15672" -
"25672" -
"61613" -
"61614" {
pool poola
}
"22" {
pool poolb
}
default {
don't do anything...
}
}