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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...