Splunk Search

Display all enabled user event without a corresponding create event and mark the time

sijssennagger
Engager

Hello everybody,

I'm trying to figure out the following problem - "Display all enabled user event without a corresponding create event and mark the time" and I just can't get it to work.
What I currently can come up with is a table with all enabled users but without the corresponding time of the event:

source="WMI:WinEventLog:Security" (EventIdentifier="4720" OR EventIdentifier="4722") | eval account_name_lookup = mvindex(Account_Name,1) | chart count by account_name_lookup EventIdentifier | search 4720=0 | table account_name_lookup

As soon as I do the chart count command the time fields disappears, which kinda make sense. I've been trying to do part of the search again ans comparing the table with the "Account_name" field but I can't get it to work. It seems to me that this should be a fairly simply search, am I overlooking something?

Tags (3)
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Try something like this

source="WMI:WinEventLog:Security" (EventIdentifier="4720" OR EventIdentifier="4722") | eval account_name_lookup = mvindex(Account_Name,1) | stats values(EventIdentifier) as EventIdentifiers, first(_time) as _time by account_name_lookup | where mvcount(EventIdentifiers)=1 AND mvindex(EventIdentifiers,0)="4722" | table account_name_lookup

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

Try something like this

source="WMI:WinEventLog:Security" (EventIdentifier="4720" OR EventIdentifier="4722") | eval account_name_lookup = mvindex(Account_Name,1) | stats values(EventIdentifier) as EventIdentifiers, first(_time) as _time by account_name_lookup | where mvcount(EventIdentifiers)=1 AND mvindex(EventIdentifiers,0)="4722" | table account_name_lookup

sijssennagger
Engager

That worked great, thanks for your help!
Next I'm going to figure out what these commands actually do 😉

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...