{"action":"created","issue":{"url":"https://api.github.com/repos/prometheus/alertmanager/issues/366","repository_url":"https://api.github.com/repos/prometheus/alertmanager","labels_url":"https://api.github.com/repos/prometheus/alertmanager/issues/366/labels{/name}","comments_url":"https://api.github.com/repos/prometheus/alertmanager/issues/366/comments","events_url":"https://api.github.com/repos/prometheus/alertmanager/issues/366/events","html_url":"https://github.com/prometheus/alertmanager/issues/366","id":158343469,"number":366,"title":"Add if statement to alertmanager.yml","user":{"login":"mateeyow","id":6420838,"avatar_url":"https://avatars.githubusercontent.com/u/6420838?v=3","gravatar_id":"","url":"https://api.github.com/users/mateeyow","html_url":"https://github.com/mateeyow","followers_url":"https://api.github.com/users/mateeyow/followers","following_url":"https://api.github.com/users/mateeyow/following{/other_user}","gists_url":"https://api.github.com/users/mateeyow/gists{/gist_id}","starred_url":"https://api.github.com/users/mateeyow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mateeyow/subscriptions","organizations_url":"https://api.github.com/users/mateeyow/orgs","repos_url":"https://api.github.com/users/mateeyow/repos","events_url":"https://api.github.com/users/mateeyow/events{/privacy}","received_events_url":"https://api.github.com/users/mateeyow/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/prometheus/alertmanager/labels/kind/question","name":"kind/question","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-06-03T11:05:48Z","updated_at":"2016-06-03T11:37:33Z","closed_at":null,"body":"Hi, I was wondering if it's possible to add an if statement to an alertmanager.yml. I'm thinking of something like this:\r\n\r\n```yml\r\nreceivers:\r\n- name: blackbox\r\n  slack_configs:\r\n  - send_resolved: true\r\n    channel: prometheus\r\n    text: \"{{if .Status eq 'firing'}} {{ .CommonLabels.instance }} is down! \\nPlease contact the team right away! {{else}} {{ .CommonLabels.instance }} is back up again! You can now relax! {{end}}\"\r\n```\r\n\r\nBut it seems that alertmanager does not recognize 'firing' word."},"comment":{"url":"https://api.github.com/repos/prometheus/alertmanager/issues/comments/223557064","html_url":"https://github.com/prometheus/alertmanager/issues/366#issuecomment-223557064","issue_url":"https://api.github.com/repos/prometheus/alertmanager/issues/366","id":223557064,"user":{"login":"mateeyow","id":6420838,"avatar_url":"https://avatars.githubusercontent.com/u/6420838?v=3","gravatar_id":"","url":"https://api.github.com/users/mateeyow","html_url":"https://github.com/mateeyow","followers_url":"https://api.github.com/users/mateeyow/followers","following_url":"https://api.github.com/users/mateeyow/following{/other_user}","gists_url":"https://api.github.com/users/mateeyow/gists{/gist_id}","starred_url":"https://api.github.com/users/mateeyow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mateeyow/subscriptions","organizations_url":"https://api.github.com/users/mateeyow/orgs","repos_url":"https://api.github.com/users/mateeyow/repos","events_url":"https://api.github.com/users/mateeyow/events{/privacy}","received_events_url":"https://api.github.com/users/mateeyow/received_events","type":"User","site_admin":false},"created_at":"2016-06-03T11:37:33Z","updated_at":"2016-06-03T11:37:33Z","body":"Pardon my ignorance but I just started learning go templates. Much more haven't learned go language yet. Anyhow, should I replace the if statement with the one you are giving? What will happened to the else statement?\r\n```\r\ntext: '{{eq .Status \"firing\"}} {{ .CommonLabels.instance }} is down! \\nPlease contact the team right away! {{else}} {{ .CommonLabels.instance }} is back up again! You can now relax! {{end}}'\r\n```\r\nIs that the correct format?"}}
{"actor":{"display_login":"mateeyow"}}