Alerting

Can a header (within the message body) be added to emailed alerts?

chris_barrett
SplunkTrust
SplunkTrust

I need to be able to put something in the first line of any emails that get sent out by the system that I'm deploying and I have not been able to find an email.header equivalent of the email.footer configuration option within alert_actions.conf.

I have contemplated having to make a customized version of apps/search/bin/sendemail.py and adding a apps/search/local/commands.conf that points to it, but I want to exhaust any other options first.

My hope is that I can have a system-wide default header which can then be overridden if necessary.

Can it be done without creating a local customization of sendemail.py?

0 Karma

somesoni2
Revered Legend

You can customize the default email body to include your custom header message, in alert_actions.conf

[email]
message.report = <string>
* Specify a custom email message for scheduled reports.
* Includes the ability to reference attributes from the result,
  saved search, or job

message.alert = <string>
* Specify a custom email message for alerts.
* Includes the ability to reference attributes from result,
  saved search, or job
0 Karma

tom_frotscher
Builder

Hi,

have you tried to use tokens?

You can add parts of the search results to the mail body:

http://docs.splunk.com/Documentation/Splunk/6.3.3/Report/Schedulereports#Use_tokens_in_scheduled_rep...

Do you run an old version? On the new versions of splunk you can easily add text and tokens to the mails via ui:

alt text

Edit: Sorry, if your main problem is that you want it per default in any mail, you may indeed need a custom sendmail.py. Or you can try to add an eval with an specific field "header" to any alert and use this in any mail report.

0 Karma
Get Updates on the Splunk Community!

3 Ways to Make OpenTelemetry Even Better

My role as an Observability Specialist at Splunk provides me with the opportunity to work with customers of ...

What's New in Splunk Cloud Platform 9.2.2406?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.2.2406 with many ...

Enterprise Security Content Update (ESCU) | New Releases

In August, the Splunk Threat Research Team had 3 releases of new security content via the Enterprise Security ...