Forum Discussion
Chris_Miller
Altostratus
Jun 11, 2010Most efficient way to do if, else?
Good morning all,
This snippet is part of an http_response event. The rule compares the IP of the server responding to datagroups to see which pool the server is in. Based on that, the rule sets a co...
Chris_Miller
Altostratus
Jun 11, 2010I've created a "dg_all_pools" of address-type in which I have all the addresses and their corresponding "strPodNumber. So, essentially, 1.1.1.1:2A1, etc.
I'm a bit fuzzy on my syntax now...I know I need to set strPodNumber to the corresponding value corresponding to the address. So, I need to compare IP::server_addr to the datagroup and use the class command to set strPodNumber to the corresponding value...can you help point me in the right direction?
Here's my swing at it...I don't quite understand the difference between class match and class search. Can I use class match - value or is -value reserved for class match?
set strPodNumber "[class search -value [[IP::server_addr] equals $::dg_pool_all]]"Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
