Hello to all, really hoping I can make sense while asking this.... I'm an entry level IT Security Specialist and I have been tasked with re-writing our current query for overnight logins as our existing query does not put out the correct information we need. Here is the current query:
source=WinEventLog:Security EventCode=4624 OR (EventCode=4776 Keywords="Audit Success")
| eval Account = mvindex(Account_Name, 1)
| eval TimeHour = Strftime(_time, "%H")
| eval Source = coalesce(Source_Network_Address, Sorce_Workstation)
| eval Source=if(Source="127.0.0.1" or Source="::1" OR Source="-" OR Source="", hos, Source)
| where (Time_Hour > 20 AND Time_Hour <24) OR (Time_Hour > 0 AND Time_Hour < 5)
| bin _time span=12h aligntime=@d+20h
| eval NightOf = strftime(_time "%m/%d/%Y)
| lookup dnslookup clienttip as Source OUTPUT clienthost as SourceDevice
| search NOT Account="*$" NOT Account=HealthMail*" NOT Account="System"
| stats count as LoginEvents values(sourceDevice) as SourceDevices by Account NightOf
| sort NightOfAccount SourceDevices
| table NightOf Account Source Devices LoginEvents
I need to somehow add an exclusion to the query for logon type 3, (meaning for splunk to omit them from its search), as well as add our asset to the query, that way splunk will only target searches from that particular asset.
I know nothing about coding, or scripts, and my boss just thought it would be super fun if the guy with the least experience try to figure it all out since the current query does not give us the data that we need for our audits. In a nutshell, we need splunk to tell us who was logged in between 8pm-5am, that it was a logon type 2 , and what computer system they were on. If anyone could help out an absolute noob here I would greatly appreciate it!
... View more