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

LogQL line format: Add Entry variable to template #4248

Open
riptl opened this issue Sep 1, 2021 · 3 comments
Open

LogQL line format: Add Entry variable to template #4248

riptl opened this issue Sep 1, 2021 · 3 comments

Comments

@riptl
Copy link

riptl commented Sep 1, 2021

Is your feature request related to a problem? Please describe.

The templates in line_format only have labels as inputs. They are missing the log entry.
This makes it impossible to do string interpolation involving the log entry.

Describe the solution you'd like

Add the .Entry variable to line_format templates containing the log entry, like was done in #2105 for promtail templates.

Describe alternatives you've considered
none

Additional context
none

@nvtkaszpir
Copy link
Contributor

this can be now mitigated by extra query filter chains:

{namespace="my-namespace"} | regexp "(?P<msg>.*)" | line_format "{{.custom_label}} {{ .msg }}"

in short msg will match everything in message, but there should be nicer way to do it.

@pgassmann
Copy link
Contributor

instead of the regex, the pattern matcher works too.
| pattern "<MESSAGE>" | line_format "{{.custom_label}} {{ .MESSAGE }}"

@jeschkies
Copy link
Contributor

@terorie would that suffice?

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

No branches or pull requests

4 participants