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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...