Getting Data In

Results on one value matching two AND field results

chrisschum
Path Finder

I'm trying to figure out a way to find out if an unknown user name matches two Windows Event Codes for a dashboard.

I want to search if a userID (Account_Name) matches both Event Codes 4740 and 4625, so that I can create a simple dashboard where you can input a userID and the results will only show those that match both codes above.

Thanks!

0 Karma
1 Solution

dragonakai
Engager

I recommend something like this. You can manipulate it further to make the formatting pretty or easy to read. You could also attempt a transaction, but I think this will be faster. Also, you will want to mess with the span in the bin command. 5 minutes may be too small. You could make that a token for a dashboard input, like with userid.

sourcetype=wineventlog* Account_Name=$userid$ EventCode=4740 OR EventCode=4625
| bin _time span=5m
| stats values(Message) values(EventCode) AS EventCodes by _time
| eval EventCodeCount=mvcount(EventCodes)
| search EventCodeCount=2

View solution in original post

dragonakai
Engager

I recommend something like this. You can manipulate it further to make the formatting pretty or easy to read. You could also attempt a transaction, but I think this will be faster. Also, you will want to mess with the span in the bin command. 5 minutes may be too small. You could make that a token for a dashboard input, like with userid.

sourcetype=wineventlog* Account_Name=$userid$ EventCode=4740 OR EventCode=4625
| bin _time span=5m
| stats values(Message) values(EventCode) AS EventCodes by _time
| eval EventCodeCount=mvcount(EventCodes)
| search EventCodeCount=2

chrisschum
Path Finder

That worked like a champ! Thanks!

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...