Forum Discussion

Mike_Wethington's avatar
Mike_Wethington
Icon for Nimbostratus rankNimbostratus
Aug 08, 2013

Using 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

  • Try:

    
    } elseif { not ( [class match [string tolower [HTTP::header "User-Agent"]]  contains mobileagent] ) }{