I have a wineventlog index to alert on locked accounts (EventCode=4740), but want to limit this based on certain users. The data for the wineventlog index is pretty limited, so it looks like I would have to reference another index like activedirectory, that contains similar data. I was thinking I could reference the "OU" field in the activedirectory index so that this is possible, but I'm struggling on what I need to combine in order to make this search work. I've looked at using coalesce, and can get results from both indexes/sourcetypes, but can't seem to just limit my search using EventCode=4740 and OU=Test Users Group.
(index="wineventlog" AND sourcetype="wineventlog" AND EventCode=4740) OR (index="activedirectory" AND sourcetype="ActiveDirectory" AND sAMAccountName=*)
| eval Account_Name = lower( coalesce( Account_Name, sAMAccountName))
| search Account_Name="test-user"
Some of the key fields that I'm trying to reference from the indexes are as follows:
index = wineventlog
sourcetype = wineventlog
EventCode=4740
Security_ID = domain\test-user
Account_Name = test-user Account_Name = dc
index = activedirectory sourcetype = ActiveDirectory Account_Name = test-user sAMAccountName = test-user OU = Test Users Group
... View more