Update notification_examples.md (#3707)
Signed-off-by: Lucas Burigo <burigolucas@users.noreply.github.com>
This commit is contained in:
parent
44d5f70c3b
commit
2fd1b52c98
|
@ -76,7 +76,7 @@ Receiver
|
||||||
## Defining reusable templates
|
## Defining reusable templates
|
||||||
|
|
||||||
Going back to our first example, we can also provide a file containing named templates which are then loaded by Alertmanager in order to avoid complex templates that span many lines.
|
Going back to our first example, we can also provide a file containing named templates which are then loaded by Alertmanager in order to avoid complex templates that span many lines.
|
||||||
Create a file under `/alertmanager/template/myorg.tmpl` and create a template in it named "slack.myorg.txt":
|
Create a file under `/alertmanager/template/myorg.tmpl` and create a template in it named "slack.myorg.text":
|
||||||
|
|
||||||
```
|
```
|
||||||
{{ define "slack.myorg.text" }}https://internal.myorg.net/wiki/alerts/{{ .GroupLabels.app }}/{{ .GroupLabels.alertname }}{{ end}}
|
{{ define "slack.myorg.text" }}https://internal.myorg.net/wiki/alerts/{{ .GroupLabels.app }}/{{ .GroupLabels.alertname }}{{ end}}
|
||||||
|
@ -102,4 +102,4 @@ templates:
|
||||||
- '/etc/alertmanager/templates/myorg.tmpl'
|
- '/etc/alertmanager/templates/myorg.tmpl'
|
||||||
```
|
```
|
||||||
|
|
||||||
This example is explained in further detail in this [blogpost](https://prometheus.io/blog/2016/03/03/custom-alertmanager-templates/).
|
This example is explained in further detail in this [blogpost](https://prometheus.io/blog/2016/03/03/custom-alertmanager-templates/).
|
||||||
|
|
Loading…
Reference in New Issue