If the Query is executed without adding a selection clause, it will display the Access List Extended Rules for every Device in the system. This can be helpful if you want global information about all the Devices in your system. This can also be a nuisance if there are a great number of devices, as the query may either take a long time to run, or the Result Set might exceed the “Row Limit” or “Memory Limit” discussed earlier.
You can select which rows you want included in the Result Set by using the Selections tab, illustrated in Selections tab. Select that the Device’s vendor is CISCO.
The Type, which can be “AND” or “OR”, selects whether a clause is combined with a boolean AND or OR operator with the previous clause. It is not applicable for the first clause (or the first clause after an open parenthesis.
The Alias and Column selections select what field in the Result View the clause tests, and are selected using pull down menus that are generated based on the alias entries in the Tables tab and the columns available from those tables.
The Operator is selected from a pull-down list. Selection tab operators defines the Selections tab operators.
Operator |
Applicable types |
Meaning |
Examples column contents operator value |
---|---|---|---|
( |
none |
A left parenthesis operator requires no other values and will force the expression down to the matching right parenthesis to be evaluated before combining the result with the rest of the selection clauses. Multiple levels or parenthesis can be used. |
-- |
) |
none |
A right parenthesis operator must have a matching left parenthesis operator above. Clauses within the parenthesis will be evaluated before combining the overall result with the rest of the selection clauses. |
-- |
= |
String, Integer, Long, INET, others |
Equal to a specified Value. (Do not use for checking equal to null).
Note:
Comparisons against NULL not valid. |
“abc”=”abc” true “ABC”=”abc” false 5=5 true NULL=5 false 1.1.1.1/24=1.1.1.1/24 |
>= |
String, Integer, Long |
Greater or equal to than specified Value. For strings, tests sort order. |
6>=5 true 5>=5 true “cde” >= “cdd” true |
> |
String, Integer, Long |
Greater than specified Value. For strings, tests sort order. |
-- |
<= |
String, Integer, Long |
Less than or equal to specified Value. For strings, tests sort order. |
-- |
< |
String, Integer, Long |
Less than specified Value. For strings, tests sort order. |
-- |
!= |
String, Integer, Long, INET, others |
Not equal to specified value.
Note:
comparisons against NULL not valid. |
“a” != “b” true NULL != “b” false |
<> |
String, Integer, Long, INET, others |
Not equal to specified value, implemented as “IS DISTINCT FROM”.
Note:
NULL values compared with non NULL values returns true. |
5 <> 6 true NULL <> “string” true NULL <> NULL false |
LIKE |
String |
Pattern matching operator. Value contains match pattern. An underscore character (_) matches any single character. A percent character (%) matches any string of zero or more characters. |
“abc” LIKE “abc%” true “abc” LIKE “ab_” true “ab” LIKE “ab_” false “abc” LIKE “ABC” false |
~ |
String |
Matches against a POSIX regular expression in Value, case sensitive. |
“abc” ~ “.*c” true “abc” ~ “.*C” false |
~* |
String |
Matches against a POSIX regular expression in Value, case insensitive. |
“abc” ~* “.bc” true “abc” ~* “.BC” true |
!~ |
String |
Does not match a POSIX regular expression in Value, case sensitive. |
“abc” !~ “.*c” false “abc” !~ “.*C” true |
!~* |
String |
Does not match a POSIX regular expression in Value, case insensitive. |
“abc” !~* “.*c” false “abc” !~* “.*C” false |
IS NULL |
Any |
Tests alias.column is NULL. No Value field required. |
a.b IS NULL |
IS NOT NULL |
Any |
Tests alias.column is not NULL. No Value field is required. |
a.b IS NOT NULL |
>>= |
Inet |
If alias.column is a Inet column, test that it contains or is exactly equal to the IP address or CIDR specified in value. |
1.1.1.0/24>>=1.1.1.5 true 1.1.1.0/24>>=1.1.2.0 false 1.1.1.0/24>>=1.1.1.16/4 true |
<<= |
Inet |
If alias.column is a Inet column, test that it is contained in or is exactly equal to the specified CIDR value |
1.1.1.5<<=1.1.1.0/24 true 1.1.2.0<<=1.1.1.0/24 false 1.1.1.0/24<<=1.1.1.0/24 true |
$= |
String, Integer, Long, other |
Tests equality against the Value field, which is assumed to contain a variable, if the result of substituting any variables in the Value field is non null. If the Value field result is NULL, the selection clause matches any non null column value. |
“abc” ~= “abc” true “abc” ~= “def” false “abc” ~= NULL true NULL ~= NULL false |
CONTAINS |
String |
Tests that the column matches a regular expression constructed from the operand pattern as “.*pattern.*”. |
abc” CONTAINS “a” true “abc” CONTAINS “bc” true “abc” contains “d” false |
The Value field input is free form text (meaning it is not validated until it is sent to the server), and can be set according to the rules defined in Value field input rules.
Form |
Examples |
---|---|
Literal constant String, Integer, Long. No quotes are required. |
5 abc |
Column specification consisting of alias and column name separated by a period. |
device.ManagementIp |
Variable reference, or String containing variable reference. (Note the insert variable convenience button that will insert any variables that have been defined on the Variables tab.) |
My string ${variablename} |
Parenthesized expression containing variables. Quotes required for strings if used. Allows functions. |
(5 + ${sum}) (inet ‘1.1.1.0/24’) |
Complicated selection clause example shows a more complicated selection clause that illustrates the use or parenthesis, logically or-ing clauses together and arithmetic comparisons.
The corresponding boolean expression is:
(device.DeviceName=’TWRouter1’ AND device.DeviceIdx>10) OR (device.deviceName=’PIX2’ AND device.DeviceIdx<10000)