Splunk Search

How to use the condition stanza in this spl query?

AL3Z
Builder

Hi, I'm trying to find the alerts by user between the period of 2 hours like Alert1,Alert2 Here I need a spl query for this condition
* And one more condition spl is  In bwtween 2hours if there is an alert for  single user more than 3 times it should raise an alert.
Thanks.

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

What have you tried so far and what results did you get?

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

AL3Z
Builder

@richgalloway 

Please have a look on usecase snapshot once. 

0 Karma

AL3Z
Builder

@richgalloway 
Hi,
Use case :1

If the user triggers pdm and encrypt alerts both in a period of 2 hours it should raise an alert.

AL3Z_0-1680098490570.jpeg

 

Use case:2

If the user triggers other than pdm in between  2 hours  for single user more than 3 times it should raise an alert .

AL3Z_3-1680098543040.jpeg

Thanks

 




 

0 Karma

richgalloway
SplunkTrust
SplunkTrust

You have the searches so what is preventing you from saving them as alerts?  Click "Save as" in the top-right corner of the search to make it into an alert.

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

AL3Z
Builder

@richgalloway 

My aim is creating a correlation search..

0 Karma

richgalloway
SplunkTrust
SplunkTrust

In Enterprise Security, go to Configure->Content->Content Management then click the "Create New Content" button and select Correlation Search.  Copy-and-paste your search from the S&R window into the Search box of the CS.  Complete the rest of the CS form and click Save.

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

AL3Z
Builder

@richgalloway 
what I'm trying to do is like

usecase1:  alert_name!="*pdm*"          by user

base search
--------------
| eval non_pdm_alert=if(alert_name!="*pdm*", 1, 0)
| sort _time
| streamstats count(non_pdm_alert) AS non_pdm_count by user time_window=2h
| where non_pdm_count>2

It is not giving desired output.

usecase 2: (alert_name="*PDM*" AND alert_name="*encrypted*")

base search

| eval both_alerts_triggered=if(alert_name="*pdm*" AND alert_name="*encrypted*", 1, 0)
| sort _time
| streamstats count(eval(both_alerts_triggered=1)) AS triggered_count by user time_window=2h
| where triggered_count>=2

 

 

0 Karma

richgalloway
SplunkTrust
SplunkTrust

I'm uncertain about what the ask.  First you asked for alerts.  Then you shared your searches and asked how to make them into correlation searches.  Now you share more searches and say the output is not what is desired.  Just what is desired?  How are the existing searches not meeting expectations?  What are those expectations?

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

AL3Z
Builder

Hi ,

@richgalloway 

My ask is if the user triggers both the alerts i.e pdm and encrypted with in a span of 2 hours.

Other one is if the user triggers non pdm alerts with in a span of 2 hours is my requirement

Please edit the above search as per the usecase.

Thanks 

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Alerts are independent.  There is no test for triggering more than one alert (unless you're using Enterprise Security).  One alert would have to test for both (or more) conditions and trigger if all are met.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...