Splunk Search

How to edit my search to limit results to a specific user?

cjsweeney1
Explorer

Hi i'm working w/ the below search and getting good results for all currently logged in user accounts but would anyone know how to search for a specific account? For example Tom Smith or tsmith?

Thanks...

sourcetype="WinEventLog:Security" OR (EventCode=540 OR EventCode=4624) NOT (user=*$ OR user="ANONYMOUS LOGON" OR user=SYSTEM OR user=services OR user=Unknown) 
 | stats dc(src_ip) as Number_logged_hosts, values(src_ip) as "Logins IPs", values(dvc) as "Domains Controller", count by user, ComputerName
 | rename user as Users, count as Total_time_logged_in 
Tags (2)
0 Karma

DalJeanis
Legend

change

 NOT (user=*$ OR user="ANONYMOUS LOGON" OR user=SYSTEM OR user=services OR user=Unknown) 

to

user=tsmith

assuming that's the format of your user names in your logs.

somesoni2
Revered Legend

You may need to use wild-cards. Best option would be to check how user name is available in your logs.

cjsweeney1
Explorer

I thought of that i'll try it...thanks!!

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...