Hello,
I am using Grafana v9.1.2 and I want to modify the Value: field in the alerting emails. For this purpose, I have found this regex filters:
{{ with .ValueString }}
{{- . | reReplaceAll `\[\s` "" | reReplaceAll `\],\s` "\n" | reReplaceAll `\]` "" | reReplaceAll `var='[A-Z0-9a-z]+'\s` "" | reReplaceAll `labels=\{[A-Za-z0-9_\-\=\s\.:,\\/]*\}\s` "" | reReplaceAll `metric='(.*)' ` "**$1**: " | reReplaceAll `value=([0-9\.]+)` "$1" }}
{{ end }}
After saving the changes to /usr/share/grafana/public/emails/ng_alert_notification.html and rebooting the grafana-server, the service could not start because of this error:
Failed to start grafana. error: template: ng_alert_notification.html:232: function "reReplaceAll" not defined
Could you please help me resolve this issue? As noted in the documentation here: Examples of template functions | Grafana documentation the function reReplaceAll should work there.
Thank you in advance!