Alerting

How do I create alerts based on a query to my mail

ellstream44
Explorer

Based on this search:

source="abc.log" 
 | rex "\"duration\" : (?<duration>\d+)"
 | rex "\"correlation\" : \"(?<correlation>[^\"]+)"
 | where duration > 50000
 | table correlation duration

I want to get
A) Either a mail to mymail@hotmail.com every time there is a hit
OR if that is not possible
B) Every hour run the query and mail me any matches.

I have searched a lot on this forum, and I cannot seem to find any place where I can do this.
Any help is appreciated greatly! 🙂

Labels (1)
Tags (3)
0 Karma

493669
Super Champion

If you haven't setup email in splunk then you need to setup email settings first-
1. Go to 'admin' and click 'system settings'

  1. Next click 'email alert settings'

  2. Set the appropriate values for your email host, username etc

  3. Set the link host so urls in the emails link back to the splunk alert correctly...ie..your splunk server host name

Then Run a search & create an alert

In the alert settings give it your email address

You can also use the 'sendemail' command which you would append to the end of your saved search along with the server settings.

Refer- https://docs.splunk.com/Documentation/Splunk/8.0.4/Alert/Setupalertactions

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Run the search. When it completes select "Alert" from the "Save As" menu in the upper-right corner. Fill in the form and click Save.

---
If this reply helps you, Karma would be appreciated.
0 Karma

ellstream44
Explorer

When I press "Save As" I cannot see Alert, only these:
"Report"
"Dashboard Panel"
"Event Type"

Perhaps an permission issue then? I tried to append an image here but it does not seem to work

0 Karma

richgalloway
SplunkTrust
SplunkTrust

I suspect a capability or permission problem. Check with your Splunk admin.

---
If this reply helps you, Karma would be appreciated.
0 Karma

ellstream44
Explorer

Will do, thanks!

0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...