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
Revered Legend

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
Revered Legend

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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

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