Splunk Search

How to add multiple email addresses in Splunk Alert based on field value?

whitefang1726
Path Finder

Hello Splunkers, 

How can we send email to multiple email addresses using Splunk alert? I saw below documentation in Splunk site, but it doesn't have any sample for multiple emails. 

https://docs.splunk.com/Documentation/Splunk/9.0.4/Alert/Emailnotification

Example: 

If country=US, recipients will be ameri@gmail.com
If country=Argentina, recipients will be ameri@gmail.com, argentina@gmail.com
If country=Mexico, recipients will be ameri@gmail.com, mexico@gmail.com
If no match, then ameri@gmail.com

Thanks!

Tags (1)
0 Karma

whitefang1726
Path Finder

I've used eval (recipients fields) same with the documentation, but "," does not worked and recipients doesn't received any emails. 

Example: 

| eval recipients=if(country, "US", "ameri@gmail.com", if(country, "Mexico", "ameri@gmail.com, mexico@gmail.com"), "ameri@gmail.com")

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Have you tried semi-colon rather then comma as a separator between e-mail addresses?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You could consider adding the recipients to the results of the search and using $result.recipients$ in the To: field.

0 Karma
Get Updates on the Splunk Community!

Demo Day: Strengthen Your SOC with Splunk Enterprise Security 8.1

Today’s threat landscape is more complex than ever. Security operation centers (SOCs) are overwhelmed with ...

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...