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
Allow filtering on missing variables #140
Comments
Yeah this is a good idea. I would make a unary function called has:
```
| where has(foo) | where foo > 50
```
…On Wed, Jun 16, 2021, 2:18 PM Jake Howard ***@***.***> wrote:
Especially useful when parsing lines of different structures with logfmt,
it's useful to say something like "only use lines where this variable
exists", or something.
This could be something where missing variables are falsy, so using where
would work as normal. Or perhaps a different operator, or a new filter
entirely (eg has). For an intuitive feel, making them falsey, or never
equal to anything in a where would be really nice, although may not be
backwards compatible.
Currently I add a contains before logfmt, which feels like a bit of a
hack.
Example
type=event value=50
path=/ response_time=50ms
Using | where value > 50 would result in an error for the second line.
Whereas being able to do | has value before it would filter out any of
those.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#140>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADYKZ3SCXYLUKQ5PNUD3RTTTEIJDANCNFSM462JCGEQ>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Especially useful when parsing lines of different structures with
logfmt
, it's useful to say something like "only use lines where this variable exists", or something.This could be something where missing variables are falsy, so using
where
would work as normal. Or perhaps a different operator, or a new filter entirely (eghas
). For an intuitive feel, making them falsey, or never equal to anything in awhere
would be really nice, although may not be backwards compatible.Currently I add a
contains
beforelogfmt
, which feels like a bit of a hack.Example
Using
| where value > 50
would result in an error for the second line. Whereas being able to do| has value
before it would filter out any of those.The text was updated successfully, but these errors were encountered: