Alerting
Highlighted

Creating Indirect / Cascading Search

Path Finder

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).

Script below:

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,
Daniel

Tags (3)
0 Karma
Highlighted

Re: Creating Indirect / Cascading Search

Path Finder

Is this possible with using the Python SDK?

0 Karma
Highlighted

Re: Creating Indirect / Cascading Search

SplunkTrust
SplunkTrust

Name of CAS servers will be a static value?

0 Karma
Highlighted

Re: Creating Indirect / Cascading Search

Path Finder

There will be multiple CAS servers, but all of them will have a static name.

0 Karma
Highlighted

Re: Creating Indirect / Cascading Search

SplunkTrust
SplunkTrust

You can look at the 'map' command using which you can run a search based on the search result of another search.
http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Map

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]

View solution in original post

Highlighted

Re: Creating Indirect / Cascading Search

Path Finder

Wow, dude. I didn't know that the map command was there. Does that mean you can ma multiple searchs, or just one?

0 Karma
Highlighted

Re: Creating Indirect / Cascading Search

SplunkTrust
SplunkTrust

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.

0 Karma
Highlighted

Re: Creating Indirect / Cascading Search

Path Finder

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?

0 Karma