Splunk Search

A user account was changed 4738 642

MrWh1t3
Path Finder

All,

I am at a loss. I am trying to pull EventCode 642 and 4738 so i can identify when a user account has been changed.

I currently have;
sourcetype="WinEventLog:Security" EventCode="642" OR EventCode="4738" | rex "(?ms)A user account was changed.+?Display Name:\s(?<wanted_user>\V+)" | table _time Display_Name Account_Name ComputerName

It works, but... There are two Account Name in the 642/4738 event logs. Our Display Name wasn't populated like it should be within AD so i don't get much useful information from it.

What I would like to see is:

_time "Account name that was changed" "Account name of the person who changed it" and the ComputerName.

Any help would be much appreciated!

0 Karma

DalJeanis
SplunkTrust
SplunkTrust

You are best off pulling samples of each and using the wording on the events, and your resulting knowledge of what fields are populated in your particular environment, to pull information off the events via rex.

The standard general wording for each is here, but it occasionally varies based on specific OS version.
https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventid=642
https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventid=4738

For instance, this pulls the Target account name off of the standard 528 and the 4738 events, respectively. Since the words "Account Name" occur twice, you need to take the second occurrence as the target account. This is one way to do that.

| rex "Target Account Name:\s+?(<TargetName>[^\s]*)"
| rex  "Account Name:\s+?(<AccountName>[^\s]*) max_match=2
| eval TargetName=coalesce(TargetName,mvindex(AccountName,1))
0 Karma
Get Updates on the Splunk Community!

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...