Splunk Search

Splunk Query to check two Conditions

prakashsbk
Explorer

Hi All

We are trying to get the incidents which are in open state (ie AlertStatus only equal to CREATE) .

Table Out is below :

prakashsbk_0-1696862234229.png

Here IncidentID 1414821 has both AlertStatus = CLEAR and CREATE , this Incident ID should not get displayed . We need IncidentID only with Alertstaus = CREATE.

we ran with

| eval IncidentID=case(AlertStatus="CREATE" AND AlertStatus!="CLEAR",IncidentID)
| table IncidentID AlertStatus 

When we run an Query it should only Display IncidentID value 1437718


 

Thanks and Regards

 

 

 

Labels (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @prakashsbk,

could you share your search?

you should use something like this:

<your_search>
| stats dc(AlertStatus) AS AlertStatus_count values(AlertStatus) AS AlertStatus BY IncidentID
| search AlertStatus_count<2 AND AlertStatus = "CREATE"
| table IncidentID AlertStatus 

having your search I could be more detailed.

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @prakashsbk,

could you share your search?

you should use something like this:

<your_search>
| stats dc(AlertStatus) AS AlertStatus_count values(AlertStatus) AS AlertStatus BY IncidentID
| search AlertStatus_count<2 AND AlertStatus = "CREATE"
| table IncidentID AlertStatus 

having your search I could be more detailed.

Ciao.

Giuseppe

prakashsbk
Explorer

Thanks a lot for your quick help and support , Query is working as expected.

 

 

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...