Alerting

How to customize email alerts for recipients?

damucka
Builder

Hello,

I have the following alert search:

index=mlbso_changelog  (crash_context OR crash_stack OR crash_shortinfo) AND source="*crash*" NOT "Table of contents" | rex field=source "(?<filename>[\w\d\.-]+$)"

The idea is to notify the system responsibles on the crashes happening in the corresponding systems. The search itself goes over the crashdump files of many systems, the only differentiation would be then over the field filename.
Now, I would like to keep it simple and have only one alert for all the systems, but depending on the content of the filename trigger the alert e-mail to the specific recipient group, like for the filename 'A' to the defined e-mail group "Owner A", etc. These are not the same people.

How would I do it?

Kind Regards,
Kamil

0 Karma
1 Solution

DMohn
Motivator

You could include a lookup in your search, which maps the recipient email address according to the filename:

index=mlbso_changelog  (crash_context OR crash_stack OR crash_shortinfo) AND source="*crash*" NOT "Table of contents" | rex field=source "(?<filename>[\w\d\.-]+$)" | lookup email_mapping filename OUTPUT recipient_mail

Then use the variable in your alert by setting the recipient field as $result.recipient_mail$

See https://docs.splunk.com/Documentation/Splunk/latest/Alert/EmailNotificationTokens for further details

View solution in original post

0 Karma

DMohn
Motivator

You could include a lookup in your search, which maps the recipient email address according to the filename:

index=mlbso_changelog  (crash_context OR crash_stack OR crash_shortinfo) AND source="*crash*" NOT "Table of contents" | rex field=source "(?<filename>[\w\d\.-]+$)" | lookup email_mapping filename OUTPUT recipient_mail

Then use the variable in your alert by setting the recipient field as $result.recipient_mail$

See https://docs.splunk.com/Documentation/Splunk/latest/Alert/EmailNotificationTokens for further details

0 Karma

damucka
Builder

Hi @DMohn

Thank you, I implemented your idea and it works perfect.

Kind Regards,
Kamil

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...