jertel / elastalert2

ElastAlert 2 is a continuation of the original yelp/elastalert project. Pull requests are appreciated!
https://elastalert2.readthedocs.org
Apache License 2.0
902 stars 284 forks source link

Multiple alert message config #1130

Closed jose-lp closed 1 year ago

jose-lp commented 1 year ago

Description

Hello, I am using eslastalert in my company, I noticed that in each .yml recipe of a rule, only one message body can be defined. But in the company we need slack and email messages to have different information. I added this feature in this pull request.

Checklist

Questions or Comments

If you think it's worth it I can do a unit test and add the feachure to the other alerts to complete the pull request requirements.

This new feature allows both general and specific settings to coexist. If there is a specific configuration for an alert, the general one will be omitted. For example:

alert_text: hello
alert_text_email: email

alert:
-  email
-  slack

In this case the slack alert will use the general message and the email alert the specific one.

jertel commented 1 year ago

Did you see this in the documentation, under the alerts section?

image

Did you try nesting the email-specific settings under the email alert key?

jose-lp commented 1 year ago

That's exactly what you need, I overlooked it. Thank you very much, your application has helped a lot