Reply

Reg expressions in Device Group criteria.

Authority
Posts: 15
2844     0

I have an issue creating a Device Group specifically for F5 load blalncers.

This device criteria results in all devices being found:

$type = "Load Balancer" and $Model eq "BIG-IP 3600" or $Model eq "BIG-IP 1600" or $Model eq "BIG-IP 4000"

This device criteria does not find any devices:

$type = "Load Balancer" and $Model eq "/^BIG-IP.+/"

Does anyone see what is wrong with the reg expression for the  second criteria?

I hope this helps you:

MGriffin
Techie
Posts: 37
2845     0

I hope this helps you:

Operators :  
The following comparison operators are supported:     

Comparison Operators     
=, ==, !=, <, >, <=, >=     numeric comparison (The value on either side of the operator should be an integer, float or IP address.)     
eq, ne, gt, lt, ge, le     string comparison (The value on either side of the operator should be a string.)     
=~, !~, like, not like     regular expression (A non-string value on the left side of operator is converted to a string before comparison.)     
    determines if a given value is contained in a list of values (The in, not in values inside of the list should be the same type as the value on the     
    left hand side of the operator.)    
memberOf,     determines if the device or interface is a member of one or more     
not memberOf     other Device Groups and/or Interface Groups     

Examples:        
 $ID = 30        
 $Vendor eq "Cisco"    
 $Version like /^12.1.*/    
 $Model in ["cat4506", "3725"]    
 $IPAddress in [10.1.3.56, 10.2.0.0/16]    
 memberOf ["Router Group", "Switch Group"]

    
To do a case-insensitive match, use the regular expression modifier "/i".

Example:     
$Name like /core/i     

The following logical operators can be used to combine comparison sub-expressions:     
Logical Operators     
and, &, &&     boolean AND     
or, |, ||     boolean OR     
(, )     grouping     

Examples:    
 $Vendor eq "Cisco" and $Type eq "Router"    
 ($Vendor eq "Juniper" and $Type eq "Router")    
 or ($Vendor eq "Cisco" and $Type in ["Router", "Switch"])    
 memberOf ["Routing Group"]    
 and $IPAddress in [10.1.0.0/16, 10.2.3.45]     
  
 

That was a help. I had seen

Authority
Posts: 15
2845     0

That was a help. I had seen that list in the Admin guide, but it didn't click until after I saw your post. In the end I was able use the following to group all of the F5 GTM and LTM devices into one group:

$vendor eq "F5" and ($Model like /^BIG-IP*/)

Showing results for 
Search instead for 
Do you mean 

Recommended for You