-
Notifications
You must be signed in to change notification settings - Fork 156
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
conditional labels #33
Comments
This is a bug, I will fix it in the next release and make
|
Please include this or the same case into tests. Labels in ADDITIONAL_INFO match are optional. |
@Nitro-N sorry for the late reply. I pushed a test for the FOOBAR example above. Could you provide an example log line for the |
|
Thanks for the examples. I pushed a test, it should work now. |
Released v0.2.5 including the fix for this issue. |
Hi,
Is it possible to have "conditional" labels ? For example, consider the following patterns :
If I match on
%{FOOBAR}
in my metrics, I can use{{.foo}}
in the labels, because it will always be present. However, as soon as I want to use{{.bar}}
, I run into problems because a line can match only%{FOO}
and not%{BAR}
, so sometimesbar
isn't in the template context, so grok_exporter becomes unhappy :Warning : Skipping log line: foobar: unexpected result when calling onig_name_to_group_numbers()
I tried to work around it by using
{{if .bar}}{{.bar}}{{end}}
to no avail.How could I achieve what I want there ? Is there a way to check that a template variable exists without making grok_exporter bail on
onig_name_to_group_numbers()
?Thanks
The text was updated successfully, but these errors were encountered: