Splunk Search

How to group data to send email alerts

Dayalss
Engager

Hi,

I have a huge set of data with different emails in it , I want to setup email alerts for few parameters.
But the issue is I'm unable to group the events on email and send a email alert with the csv attachment of the results.

Example:-

abc@email has around 80 events in the table , I want to send only one alert to abc with all the 80 events in it as csv attachment.

And there are around 85+ emails in my data , and they have to be grouped using only 1 spl and it should be used in alert.

Note :- dont suggest $result.field$  or stats to group its not useful for me.

Thank you


Labels (1)
0 Karma

victor_menezes
Communicator

Have you tried to consolidate then via stats command and then configure your alert to trigger for each result and tokenize the email parameter?

Try this (adjust to your reality):

<your search> | stats values(event_field) as events by user, email

Then in your alert configuration, set trigger conditions:
Number of results > 0
Trigger: For each result

And add the email action with To with token $result.email$

That will make each email receive their group of events


Give it a try and let me know 

0 Karma

Dayalss
Engager

I feel if we can first group the events on email and then use the email as a token in the email recipient , we can do it .

But Im not getting how we can do that.

0 Karma

PickleRick
SplunkTrust
SplunkTrust

I don't understand. You want to send different set of results to different people as a single alert action?

No can do.

You could try using https://splunkbase.splunk.com/app/1794

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!

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...