Hi Splunk Community,
I have, I would hope to be, a simple question.
Our company has always monitored domain account lockouts, but recently we wanted to take it a bit further, and monitor IIS logs for potential lockouts attempted to authenticate against our Exchange CAS servers.
Therefore, our main real-time search script is as such:
index!=audit EventCode=4740 | table _time, EventCodeDescription, AccountName, SecurityID, AccountDomain, CallerComputerName, | eval time=strftime(time, "%H:%M:%S %m-%d-%y") | fields - raw | rename _time AS When?, Message AS Who?Where?
I had an idea that, instead of going through the hassle of associating fields between WinEventLog:Security and iis to figure out why someone would get locked out on our CAS server, it would be more efficient to generate a report of the past 10minutes (give or take 3minutes haven't decided on that), for scwin32status=1326 (bad username or password from iis).
sourcetype="iis" scwin32status=1326 | eval username=lower(csusername) | fillnull | stats count by username, csuristem, csUser_Agent | where count>1 AND count<6 | sort by count desc
My goal would be to generate this IIS report when the CallerComputerName is equal to the name of one of our CAS servers when the EventCode=4740 alert is thrown.
Is there a way to achieve this?
Thank you in advance,
You can look at the 'map' command using which you can run a search based on the search result of another search.
Its should be basically something like this
index!=_audit EventCode=4740 Caller_Computer_Name="YourCASServerName"| stats count | where count > 0 | map [search sourcetype="iis" sc_win32_status=1326 | eval username=lower(cs_username) | fillnull | stats count by username, cs_uri_stem, cs_User_Agent | where count>1 AND count<6 | sort by count desc]
Its basically for each search result in base search, you can run the subsearch specified in map command (that's why I used stats to limit base search results to 1). You can't map multiple searches directly but there are workarounds.
It looks like this can't be run as a real-time alert because it will alert every time that there is a match in the subsearch. Is that a bug?