You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(storage/bloom): support simplifiable regexp matchers (#14622)
This adds support for basic regexps which can be simplified into a sequence of
OR matchers, such as:
* `key=~"value" becomes key="value"
* `key=~"value1|value2" becomes key="value1" or key="value2".
* `key=~".+" checks for the presence of key. This is currently the only way to
check if a key exists.
Only the cases above are "officially" supported. However, we technically
support basic concatenations and character classes due to how regexp/syntax
parses and simplifies expressions such as `value1|value2` into `value[12]`.
To prevent unbounded cardinality, we limit regexp expansion to 25 matchers;
otherwise a regexp like `value[0-9][0-9][0-9][0-9]` would expand into 10,000
matchers (too many!).
Closesgrafana/loki-private#1106.
Co-authored-by: J Stickler <julie.stickler@grafana.com>
Copy file name to clipboardExpand all lines: docs/sources/query/query_accceleration.md
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,11 @@ If [bloom filters][] are enabled, you can write LogQL queries using [structured
26
26
Queries will be accelerated for any [label filter expression][] that satisfies _all_ of the following criteria:
27
27
28
28
* The label filter expression using **string equality**, such as `| key="value"`.
29
+
*`or` and `and` operators can be used to match multiple values, such as `| detected_level="error" or detected_level="warn"`.
30
+
*_Basic_ regular expressions are automatically simplified into a supported expression:
31
+
*`| key=~"value"` is converted to `| key="value"`.
32
+
*`| key=~"value1|value2"` is converted to `| key="value1" or key="value2"`.
33
+
*`| key=~".+"` checks for existence of `key`. `.*` is not supported.
29
34
* The label filter expression is querying for structured metadata and not a stream label.
30
35
* The label filter expression is placed before any [parser expression][], [labels format expression][], [drop labels expression][], or [keep labels expression][].
0 commit comments