Forum Discussion
Mike_Wethington
Nimbostratus
Aug 08, 2013Using Class match to look for item NOT in datagroup
Snippet of the rule
This works as it is looking for a match:
} elseif {[class match [string tolower [HTTP::header "User-Agent"]] contains mobileagent]}{
Redirect the request
HTTP::respond 302 Location "]"
I have tried using !=, Not, Not Equals in place of the Contains but i get an error stating that it has to be, contains, ends_with, equals, starts_with. There has to be away to find if the value is not in the datagroup why would F5 not make it as easy as a Not Equals etc? Any help is appreciated.
2 Replies
- Kevin_Stewart
Employee
Try:} elseif { not ( [class match [string tolower [HTTP::header "User-Agent"]] contains mobileagent] ) }{ - Mike_Wethington
Nimbostratus
Perfect works like a charm. You rock thanks for the quick reply!
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