Forum Discussion
Dan_103700
Nimbostratus
Mar 11, 2011Nested Conditionals and NOT conditionals
Hi there,
I've been meaning to ask for awhile how to do nested conditionals and use a "not" operator in iRules.
I frequently end up writing iRules that look like this:
if...
hoolio
Cirrostratus
Mar 11, 2011Hi Dan,
Make sure to use parentheses (not curly braces) when negating checks. Else, you'll get syntax errors or the wrong tests performed:
if { not ($foo starts_with "bar") } {
pool foo_pool
}
Without the parens, you'd be negating $foo and then seeing if that starts with "bar".
Aaron
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
