|
21 | 21 |
|
22 | 22 | To combine multiple expressions you can use logical operator and brackets. |
23 | 23 |
|
24 | | -| Operator | Alias | Description | |
25 | | -| -------- | -------| ----------- | |
26 | | -| `and` | `&&` | Logical **and** operator | |
27 | | -| `or` | `\|\|` | Logical **or** operator | |
| 24 | +| Operator | Alias | Description | Example | |
| 25 | +| -------- | -------| ------------------------ | ------------------------ | |
| 26 | +| `and` | `&&` | Logical **and** operator | count = 0 and state != 1 | |
| 27 | +| `or` | `\|\|` | Logical **or** operator | used > 5 or free < 20 | |
28 | 28 |
|
29 | 29 | ex.: |
30 | 30 |
|
31 | 31 | filter="(status = 'started' or status = 'pending') and usage > 5%" |
32 | 32 |
|
33 | 33 | ## Operator |
34 | 34 |
|
35 | | -| Operator | Alias / Safe expression | Types | Description | |
36 | | -| ----------- | --------------------------- | --------| ----------- | |
37 | | -| `=` | `==`, `is`, `eq` | Strings, Numbers | Matches on **exact equality**, ex.: `status = 'started'` | |
38 | | -| `!=` | `is not`, `ne` | Strings, Numbers | Matches if value is **not exactly equal**. ex.: `5 != 3` | |
39 | | -| `like` | | Strings | Matches if value contains the condition (**substring match**), ex.: `status like "pend"` | |
40 | | -| `unlike` | `not like` | Strings | Matches if value does **not contain** the **substring**, ex.: `status unlike "stopped"` | |
41 | | -| `ilike` | | Strings | Matches a **case insensitive substring**, ex.: `name ilike "WMI"` | |
42 | | -| `not ilike` | | Strings | Matches if a **case insensitive substring** cannot be found, ex.: `name not ilike "WMI"` | |
43 | | -| `~` | `regex`, `regexp` | Strings | Performs a **regular expression** match, ex.: `status ~ '^pend'` | |
44 | | -| `!~` | `not regex`, `not regexp` | Strings | Performs a **inverse regular expression** match, ex.: `status !~ 'stop'` | |
45 | | -| `~~` | `regexi`, `regexpi` | Strings | Performs a **case insensitive regular expression** match, ex.: `status ~~ '^pend'`. An alternative way is to use `//i` as in `status ~ /^pend/i` | |
46 | | -| `!~~` | `not regexi`, `not regexpi` | Strings | Performs a **inverse case insensitive regular expression** match, ex.: `status !~~ 'stop'` | |
47 | | -| `<` | `lt` | Numbers | Matches **lower than** numbers, ex.: `usage < 5%` | |
48 | | -| `<=` | `le`, `lte` | Numbers | Matches **lower or equal** numbers, ex.: `usage <= 5%` | |
49 | | -| `>` | `gt` | Numbers | Matches **greater than** numbers, ex.: `usage > 5%` | |
50 | | -| `>=` | `ge`, `gte` | Numbers | Matches **greater or equal** numbers, ex.: `usage >= 5%` | |
51 | | -| `in` | | Strings | Matches if element **is in list** ex.: `status in ('start', 'pending')` | |
52 | | -| `not in` | | Strings | Matches if element **is not in list** ex.: `status not in ('stopped', 'starting')` | |
| 35 | +| Operator | Alias / Safe expression | Types | Case Sens. | Description | |
| 36 | +| ----------- | --------------------------- | -----------------| ---------- | ----------- | |
| 37 | +| `=` | `==`, `is`, `eq` | Strings, Numbers | Yes | Matches on **exact equality**, ex.: `status = 'started'` | |
| 38 | +| `!=` | `is not`, `ne` | Strings, Numbers | Yes | Matches if value is **not exactly equal**. ex.: `5 != 3` | |
| 39 | +| `like` | `ilike` | Strings | No | Matches if value contains the condition (**case insensitive substring match**), ex.: `status like "pend"` | |
| 40 | +| `unlike` | `not like`, `not ilike` | Strings | No | Matches if value does **not contain** the **case insensitive substring**, ex.: `status unlike "stopped"` | |
| 41 | +| `slike` | `strictlike` | Strings | Yes | Matches a **case sensitive substring**, ex.: `name slike "WMI"` | |
| 42 | +| `not slike` | `not strictlike` | Strings | Yes | Matches if a **case sensitive substring** cannot be found, ex.: `name not slike "WMI"` | |
| 43 | +| `~` | `regex`, `regexp` | Strings | Yes | Performs a **regular expression** match, ex.: `status ~ '^pend'` | |
| 44 | +| `!~` | `not regex`, `not regexp` | Strings | Yes | Performs a **inverse regular expression** match, ex.: `status !~ 'stop'` | |
| 45 | +| `~~` | `regexi`, `regexpi` | Strings | No | Performs a **case insensitive regular expression** match, ex.: `status ~~ '^pend'`. An alternative way is to use `//i` as in `status ~ /^pend/i` | |
| 46 | +| `!~~` | `not regexi`, `not regexpi` | Strings | No | Performs a **inverse case insensitive regular expression** match, ex.: `status !~~ 'stop'` | |
| 47 | +| `<` | `lt` | Numbers | - | Matches **lower than** numbers, ex.: `usage < 5%` | |
| 48 | +| `<=` | `le`, `lte` | Numbers | - | Matches **lower or equal** numbers, ex.: `usage <= 5%` | |
| 49 | +| `>` | `gt` | Numbers | - | Matches **greater than** numbers, ex.: `usage > 5%` | |
| 50 | +| `>=` | `ge`, `gte` | Numbers | - | Matches **greater or equal** numbers, ex.: `usage >= 5%` | |
| 51 | +| `in` | | Strings | Yes | Matches if element **is in list** ex.: `status in ('start', 'pending')` | |
| 52 | +| `not in` | | Strings | Yes | Matches if element **is not in list** ex.: `status not in ('stopped', 'starting')` | |
| 53 | + |
| 54 | +## Other Operators |
| 55 | + |
| 56 | +For backwards compatibility there more operators available: |
| 57 | + |
| 58 | +| Operator | Alias | Description | Example | |
| 59 | +| -------- | --------| ----------------| --------------------------- | |
| 60 | +| `''` | `str()` | String constant | exe like str(winlogon.exe) | |
0 commit comments