Splunk Search

How do I combine my two alerts into a single search?

samsingnok
Engager

The use case involves two alerts:

ALERT 1: raising the alert when more than 4 systems got affected with the same virus OR worm signature WITHIN 20 MINS and bringing the output contains only one field WHICH IS IP ADDRESS of the infected machines.

QUERY for alert 1:

index=sepm sourcetype=symantec:ep:risk:file 
Risk_Name!="W32.Ackantta!Dr"
Risk_Name!="Tracking Cookies"
Risk_Name!="xCmdSvc" 
Risk_Name!="WS.Reputation.1"
Risk_Name!="JS.Downloader"  Source!="Scheduled Scan" (Category_type="*Virus" OR Category_type="Security Risk")
| bucket span=20min _time as bucket_time| eval Bucket_Time=strftime(bucket_time,"%m/%d/%y %H:%M:%S")
| stats dc(dest_ip) as Count values(dest_ip) as Infected_machns by Risk_Name Bucket_Time category| where Count > 4| table Infected_machns 

ALERT 2: raising the alert when any type of traffic detected from the above "Infected_machns" to any machines within a 20 minute period.
QUERY FOR ALERT2:

index=sepm sourcetype=symantec:ep:traffic:file Action=Allowed | stats dc(dest_ip) as Count2 by Infected_machns | where Count2 > 3

How can I combine both these alerts in a single search?

Kindly help me.
Thanks in advance

0 Karma

woodcock
Esteemed Legend

Like this:

index=sepm sourcetype=symantec:ep:traffic:file Action=Allowed [index=sepm sourcetype=symantec:ep:risk:file 
Risk_Name!="W32.Ackantta!Dr"
Risk_Name!="Tracking Cookies"
Risk_Name!="xCmdSvc" 
Risk_Name!="WS.Reputation.1"
Risk_Name!="JS.Downloader"  Source!="Scheduled Scan" (Category_type="*Virus" OR Category_type="Security Risk")
| bucket span=20min _time as bucket_time| eval Bucket_Time=strftime(bucket_time,"%m/%d/%y %H:%M:%S")
| stats dc(dest_ip) as Count values(dest_ip) as Infected_machns by Risk_Name Bucket_Time category
| where Count > 4 | table Infected_machns | stats values(Infected_machns) AS src_ip]
| stats dc(dest_ip) as Count2 by src_ip | where Count2 > 3
0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

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 ...