Coming from Advanced
Every Advanced operator and function as a filter, what changes, and what cannot be written as a filter.
This page is for people who wrote SQL-like text in the Advanced tab. It shows each operator and function as a filter. Advanced text such as type = "ERROR" AND workload IN ("payment", "cart") becomes type:ERROR workload:(payment OR cart). KubeSense converts an Advanced filter when you open it in the Basic tab, and a notice names any change in meaning. See What changed when your filter was converted.
warning: Advanced is being retired. It becomes read-only first, then it is removed. Review your saved filters while Advanced is still next to the Basic tab, so you can compare the rows.
Operators
| Advanced | Example | Filter | What changes |
|---|---|---|---|
= | workload = "payment" | workload:payment | Nothing. |
!= | workload != "payment" | -workload:payment | Nothing. |
IN | type IN ("ERROR", "WARN") | type:(ERROR OR WARN) | Nothing. |
NOT IN | type NOT IN ("DEBUG", "TRACE") | -type:(DEBUG OR TRACE) | Nothing. |
LIKE | workload LIKE "pay_ent%" | workload:pay?ent* | % becomes * and _ becomes ?. Letter case still matters. |
NOT LIKE | workload NOT LIKE "pay" | -workload:~*pay* | Advanced wrapped a value with no % in % and ignored case. The filter writes both out. |
ILIKE | workload ILIKE "%pay%" | workload:~*pay* | ~ ignores letter case. |
NOT ILIKE | workload NOT ILIKE "%pay%" | -workload:~*pay* | Nothing. |
SUBSTR_ILIKE | workload SUBSTR_ILIKE "pay" | workload:~*pay* | Nothing. A substring that ignores case. |
MATCH | workload MATCH "pay.*" | workload:pay* | Only when the pattern is a plain glob such as .*. See A regular expression, now a pattern. |
MATCH, several patterns | body MATCH ("Trans.*", "Pay.*") | body:(Trans* OR Pay*) | Several patterns become one list. Any pattern that is not a plain glob stays as /regex/ and is reported. |
AND, OR | type = "ERROR" AND (workload = "payment" OR workload = "cart") | type:ERROR (workload:payment OR workload:cart) | A space also means AND. |
NOT (group) | NOT (type = "DEBUG" OR type = "TRACE") | NOT (type:DEBUG OR type:TRACE) or -(type:DEBUG OR type:TRACE) | Nothing. |
Filters quote only with double quotes, and only when the value needs them. See Quotes and escapes.
| Advanced | Example | Filter | What changes |
|---|---|---|---|
>, >=, <, <= on a number | duration_ms > 100 | duration_ms>100 | The value is a plain number of milliseconds. |
>= on an attribute | @http.status_code >= 500 | @http.status_code>=500 | Nothing. |
= on an attribute | @http.route = "/checkout" | @http.route:/checkout | Nothing. |
| Advanced | Example | Filter | What changes |
|---|---|---|---|
exist(@key) | exist(@user.id) | @user.id:* | Nothing on logs. On traces, Advanced gave an error. See An exist check that errored, now works. |
not_exist(@key) | not_exist(@user.id) | -@user.id:* | Nothing. |
exist(column) | exist(workload) | workload:* | Means a value that is not empty. See An exist check on a column. |
= on a list element | @tags[*] = prod | @tags[*]:prod | Matches when any element is prod. See Lists in a log. |
Functions
hasAnyToken, hasAllToken and multiSearchAny keep their meaning on body. On any other field a filter has no word search, so hasAnyToken and HAS_TOKEN become an exact match, hasAllToken with one value does the same, and multiSearchAny becomes a substring test that ignores case.
On body:
| Advanced | Example | Filter | What changes |
|---|---|---|---|
hasAnyToken | body hasAnyToken ("timeout", "refused") | body:(timeout OR refused) | Nothing. |
hasAllToken | body hasAllToken ("connection", "reset") | body:(connection AND reset) | Nothing. |
multiSearchAny | body multiSearchAny ("oom", "sigkill") | body:(*oom* OR *sigkill*) | Substring tests, as before. |
= | body = "timeout" | body:timeout | The word now matches anywhere in the body, in any case. See Body equality becomes a word search. |
LIKE, ILIKE | body ILIKE "%timeout%" | body:*timeout* | body ignores letter case in both. |
SUBSTR_ILIKE | body SUBSTR_ILIKE "timeout" | body:*timeout* | Nothing. |
On every other field:
| Advanced | Example | Filter | What changes |
|---|---|---|---|
hasAnyToken, HAS_TOKEN | workload hasAnyToken ("payment", "checkout") | workload:(payment OR checkout) | An exact match, so the value must be payment or checkout, not repayments or payment-api. See Word search on a field becomes an exact match. |
hasAllToken with one value | workload hasAllToken ("payment") | workload:payment | The same change. |
hasAllToken with several values | workload hasAllToken ("payment", "checkout") | No filter form | A value cannot equal all of them. The filter stays in Advanced. |
ILIKE_LOG | workload ILIKE_LOG "payment" | workload:~*payment* | A substring test, so repayments also matches payment. See Case-insensitive log search on a field becomes a substring match. |
multiSearchAny | workload multiSearchAny ("Pay", "cart") | workload:(~*pay* OR ~*cart*) | Nothing. It was already a case-insensitive substring test. |
Dashboard variables
A filter writes a variable that is part of a value as ${name}. See Variables on dashboards.
| Advanced | Example | Filter | What changes |
|---|---|---|---|
SUBSTR_ILIKE with a variable | namespace SUBSTR_ILIKE "$env" | namespace:~*${env}* | A substring of any selected value, ignoring case. A _ or a backslash in a value matches as itself. |
LIKE with a variable | workload LIKE "$svc%" | workload:${svc}* | With several values, the * applies to each one. |
| Advanced | Example | Filter | What changes |
|---|---|---|---|
| A field reference | $$svc AND type = ERROR | $$svc type:ERROR | Nothing. $$svc is still the variable's field with its selected values. |
A field reference under NOT | NOT $$svc | -$$svc | Nothing. |
A term that names a variable the dashboard does not have is ignored in a filter. A filter that names only such variables now converts. The rows stay the same when the missing variable stood alone, and change when it was inside a condition.
| Advanced | Example | Filter | What changes |
|---|---|---|---|
| A missing field reference | $$nope AND type = "ERROR" | type:ERROR | Nothing. |
| A missing variable in a condition | workload = "$nope" AND type = "ERROR" | type:ERROR | It ran as a search for the text $nope and returned no rows. It now matches every ERROR row. See A variable the dashboard does not have, ignored. |
Off a dashboard, a $name is ordinary text. See Variables on dashboards.
What cannot be written as a filter
A filter keeps one meaning per text on every screen, so a few Advanced behaviors have no filter form.
- Case-sensitive search on
body.bodyignores letter case in every filter. A log pipeline rule that kept case converts to a regular expression,body:/Payment/. See Regular expressions. - Word search on other fields. Only
bodyhas word search. On another fieldhasAnyTokenbecomes an exact match, andhasAllTokenwith several values has no form. Writeworkload:~*word*to match text anywhere in a value. - Regular expressions outside pipelines.
/regex/works only in log pipeline conditions and log-to-metric filters. See A regular expression that a filter cannot take here. - SQL operators. A filter does not accept
=,!=,INorLIKEas text. When you type one, the filter bar shows the filter form. See Errors.