So I tried the reReplaceAll function to replace the localhost for my own ip address, but it did not appear to work as expect.
here is what my template looks like
{{ define “moji” -}}
[{{.Status}}] {{ .Labels.alertname }}
{{ range .Alerts}}
Labels:
{{ range .Labels.SortedPairs -}}
- {{ .Name }}: {{ .Value }}
{{ end -}}
{{ if .Annotations -}}
Annotations:
{{ range .Annotations.SortedPairs -}}
- {{ .Name }}: {{ .Value }}
{{ end -}}
{{ end -}}
{{if .SilenceURL -}}
Slience: {{reReplaceAll .SilenceURL “(.)localhost:(.)” “(.)192.168.1.1:(.)”}}
{{ end -}}
{{- end }}
{{- end }}