Forum Discussion
If not a , b, or c, do 1 through 15
I can't seem to get two negative conditionals to work and I don't have the option to invert the checks and use switch.
This works OK:
when HTTP_REQUEST {
if { !([HTTP::uri] starts_with "/blah") }{
do something
}
}
This doesn't:
when HTTP_REQUEST {
if { ( !([HTTP::uri] starts_with "/blah")) or ( !([HTTP::uri] starts_with "/blah2")) }{
do something
}
}
Ideally, l'd like to have a rule that says if the URI doesn't start with any of these five things continue with the rest of the irule.
Any suggestions?
2 Replies
- hoolio
Cirrostratus
Hi,
Here's an example:when HTTP_REQUEST { switch -glob [HTTP::uri] { "/a*" - "/d*" - "/f*" { Do nothing } default { Did not match a, d or f so do something } } }
Aaron - mdcarson_58978
Nimbostratus
Pretty basic. I should have figured that out. I find solutions for my problems in your past forum posts all the time. Thanks for your help Aaron!
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
* 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
