Hi @whitecat001, Assuming your Active Directory logs are being indexed under "index=windows" and you are forwarding the logon events EventCode=4624 (successful logons), you can use the following query: index=windows* source="WinEventLog:Security" sourcetype=xmlwineventlog host=* user!="*$" EventCode=4624 dest_nt_domain=<your domain name>
| stats max(_time) as last_login by index, host, dest, dest_nt_domain, user, src_ip, Logon_Type
| eval last_login=strftime(last_logon, "%Y-%m-%d %H:%M:%S") The EventCode=4624 filters the logs to only include successful logon events. You can use the field "Logon_Type", which points out how the user logged on. There are a total of nine different types of logons, the most common logon types are: logon type 2 (interactive) and logon type 3 (network). Any logon type other than 5 (which denotes a service startup) is a red flag. Logon Type Logon Title Description 0 System Used only by the System account, for example at system startup. 2 Interactive A user logged on to this computer. 3 Network A user or computer logged on to this computer from the network. 4 Batch Batch logon type is used by batch servers, where processes may be executing on behalf of a user without their direct intervention. 5 Service A service was started by the Service Control Manager. 7 Unlock This workstation was unlocked. 8 NetworkCleartext A user logged on to this computer from the network. The user's password was passed to the authentication package in its unhashed form. The built-in authentication packages all hash credentials before sending them across the network. The credentials do not traverse the network in plaintext (also called cleartext). 9 NewCredentials A caller cloned its current token and specified new credentials for outbound connections. The new logon session has the same local identity, but uses different credentials for other network connections. 10 RemoteInteractive A user logged on to this computer remotely using Terminal Services or Remote Desktop. 11 CachedInteractive A user logged on to this computer with network credentials that were stored locally on the computer. The domain controller was not contacted to verify the credentials. 12 CachedRemoteInteractive Same as RemoteInteractive. This is used for internal auditing. 13 CachedUnlock Workstation logon. best regards, P.S.: Karma Points are always appreciated 😉
... View more