Hi, folk.
I wanna use custom email template for notification. I've found some template (in attachment). Changed it a little. And now title of email looks like this:
But It's unreadable. I want to create some template which will look like:
[FIRING:1] {{ .labels.custom_host }}:{{ .labels.alertname }}
I want to include only few labels (custom_name and alertname) into email title. How can I do it?
Here's the row from default.tmpl which is intended for creating email title:
{{ define "__subject" }}[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ .GroupLabels.SortedPairs.Values | join " " }} {{ if gt (len .CommonLabels) (len .GroupLabels) }}({{ with .CommonLabels.Remove .GroupLabels.Names }}{{ .Values | join " " }}{{ end }}){{ end }}{{ end }}