Splunk Search

How to filter two different actions events based on a common field in both

massumtaqi
New Member

if an action 1 triggers one event of common field=A and action 2 triggers ten events of common field= A, B or C. How do i identify and filter the Acton 1 and 2 separately?

Tags (1)
0 Karma

woodcock
Esteemed Legend

Like this (or similar):

((index="YouShouldAlwaysSpecifyAnIndex" AND sourcetype="AndSourcetypeToo") OR (index="YouShouldAlwaysSpecifyOtherIndex" AND sourcetype="AndOtherSourcetypeToo")) AND Logon_Type="*"
| stats latest(_raw) AS _raw count dc(sourcetype) AS sourcetypeCount BY host
| where count>1 OR sourcetypeCount>1
0 Karma

massumtaqi
New Member
EventCode=4624
| rex "(?ms)Logon Type:...(?<Logon_Type>\w+)"
| rex "(?ms)New Logon:\s+Security ID:..(?<Login_Security_ID>[AEW]+.\w+.\w+)"
| where (like (Login_Security_ID,"%mtaqi.a%"))
| where Logon_GUID!="{00000000-0000-0000-0000-000000000000}"

This is my code above that shows all 13 events for both actions . what do i do to see only event 1 of logon_type 3 caused by first action ?

The code you provided also show all 13 events

0 Karma

woodcock
Esteemed Legend

Show sample events and mockup of desired final output.

0 Karma

massumtaqi
New Member

Action one triggers 1 event :

Logon_Type
3
_time
2019-05-10T14:38:12.000-0400

Action two triggers 12 concurrent events :

Logon_Type
3
3
3
3
3
3
3
3
3
3
10
3

_time
2019-05-10T14:32:13.000-0400
2019-05-10T14:32:12.000-0400
2019-05-10T14:32:12.000-0400
2019-05-10T14:32:12.000-0400
2019-05-10T14:32:12.000-0400
2019-05-10T14:32:12.000-0400
2019-05-10T14:32:12.000-0400
2019-05-10T14:32:12.000-0400
2019-05-10T14:32:11.000-0400
2019-05-10T14:32:11.000-0400
2019-05-10T14:32:10.000-0400

I want to see first one only

0 Karma

woodcock
Esteemed Legend

First of all, your sample events don't make sense: your "first event" has a timestamp after all of the other events that "it caused" and your 12 events only have 11 timestamps listed (worst of all, the one that is not there is the most important one, the one that you desire). You should install the Windows TA so that your field extractions are automatic. I say this all the time: sow us your sample events (you were close but not all the way there), and a mockup of your desired final output. Then we can help.

0 Karma
Get Updates on the Splunk Community!

Modern way of developing distributed application using OTel

Recently, I had the opportunity to work on a complex microservice using Spring boot and Quarkus to develop a ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had 3 releases of new security content via the Enterprise Security ...

Archived Metrics Now Available for APAC and EMEA realms

We’re excited to announce the launch of Archived Metrics in Splunk Infrastructure Monitoring for our customers ...