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

Filter with the pattern #12347

Closed
cyriltovena opened this issue Mar 25, 2024 · 3 comments · Fixed by #12398
Closed

Filter with the pattern #12347

cyriltovena opened this issue Mar 25, 2024 · 3 comments · Fixed by #12398
Assignees
Labels
type/feature Something new we should do

Comments

@cyriltovena
Copy link
Contributor

cyriltovena commented Mar 25, 2024

Right now you can only use

| pattern `foo <buzz> bar`

to extract fields/labels (e.g buzz here) but you can't use it for filtering non matching log line of that pattern.

While we can easily make the suggested pattern filtering by replacing fields with regex

|~ `foo (.*) bar

this is by far inefficient.

I suggest we introduce a new way in the language to filter with the pattern language. This will be much more efficient and less problematic with control character which has been proven to be painful in my previous hackathon.

We should be able to filter in and out with pattern. Part of the task is to suggest the two new language syntax addition.

@cyriltovena cyriltovena added the type/feature Something new we should do label Mar 25, 2024
@jeschkies
Copy link
Contributor

you can't use it for filtering non matching log line of that pattern

That sounds like the syntax should be ! pattern `foo <buzz> bar` following !~.

@cyriltovena
Copy link
Contributor Author

What would be the alternative for filtering in ?

@kolesnikovae
Copy link
Contributor

kolesnikovae commented Mar 28, 2024

After an internal discussion, we have decided to extend the syntax by introducing a new line filter operator:

|> "pattern string"

If you're using font ligatures, it's displayed as a nice arrow glyph:
image

And exclamation sign instead of the pipe for negation (w/o a ligature):

!> "pattern string"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature Something new we should do
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants