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!

Splunk Observability Cloud’s AI Assistant in Action Series: Analyzing and ...

This is the second post in our Splunk Observability Cloud’s AI Assistant in Action series, in which we look at ...

Elevate Your Organization with Splunk’s Next Platform Evolution

 Thursday, July 10, 2025  |  11AM PDT / 2PM EDT Whether you're managing complex deployments or looking to ...

Splunk Answers Content Calendar, June Edition

Get ready for this week’s post dedicated to Splunk Dashboards! We're celebrating the power of community by ...