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
Grafana Oncall templates new helper filter regex_replace() #226
Comments
@njohnstone2 thank you for implementing this feature! |
No worries and thanks for accepting the change! |
Hi i am trying to get Metric and value output separately and did same for web template but for Microsoft team Template same rule are not able to apply . is there any specific reason for that Metric = {{payload.valueString|regex_replace("[ var='.' metric='", "")|regex_replace("'.", "")}} |
@matiasb could you please check this one ☝️ ? Thank you! |
Here are my 2cents how to filter the
Slack template:
|
Grafana Oncall currently supports the default jinja2 filter functions with a handful of helper functions included in this repo. I would like to propose adding a new filter to support the use of regex to replace values within a template.
Grafana alerts provide a
valueString
field in the payload that is sent to grafana oncall. I would like to include this value in my alerting template however customizing this field is limited to the existing jinja2 filtering functions.Example
Given the following
valueString
it would be nice to have the option to strip out thevar
field to display a more concise summary of what values are triggering the alert.Payload
Message Template
Desired Output
The text was updated successfully, but these errors were encountered: