Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inconsistent =~ behavior in LogQL with empty matchers #13887

Open
sandeepsukhani opened this issue Aug 14, 2024 · 0 comments
Open

inconsistent =~ behavior in LogQL with empty matchers #13887

sandeepsukhani opened this issue Aug 14, 2024 · 0 comments

Comments

@sandeepsukhani
Copy link
Contributor

Describe the bug
The behavior of =~ with empty matches("") behaves inconsistently (oppositely) depending on whether it is being used in a stream selector or a line filter expression. When it is used in index labels, it excludes all the streams with a label with the given name, while as a line filter, it matches everything.

For example:
The following query matches nothing when the probe label always has values:
{service_name="foo", probe=~""} | logfmt

Same query, except moving the stream filter out of the {} and using it as a line filter expression:
{service_name="foo"} | logfmt | probe=~""

This query returns everything that matches {service_name="brand-new-check"}, regardless of the probe value.

Code-wise, we need to change the behaviour in regex simpler. However, it might be hard to fix this issue since it would be a breaking change because, suddenly, users would stop seeing data for queries which earlier returned non-empty responses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants