Splunk Search

How to extract usernames from Windows event log 4648 in Splunk?

Pundittech
Loves-to-Learn Lots

hi

Have a large index that contains event logs. Trying to extract usernames of EventID 4648.

How can I get this displayed along with the computer name it logged into?

Thanks in advance.

Labels (1)
Tags (1)
0 Karma

Pundittech
Loves-to-Learn Lots

@gcuselloI sent you a PM. Thanks

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Pundittech,

it's an xml format, if you use the INDEXED_EXTRACTIONS=xml in props.conf (on Forwarder, Indexer and Searc Head) you should have all the field extracted.

In addition, you could use the spath command (https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Spath) to extract all fields.

At the end, you can also use a regex like the following:

| rex "\<Data Name\=\'SubjectUserName\'\>(?<UserName>[^\<]+)"

that you can test at https://regex101.com/r/ubUniP/1

Ciao.

Giuseppe

gcusello
SplunkTrust
SplunkTrust

Hi @Pundittech ,

I tried spath using your sample logs and it extracts all fields.

Anyway, you can also use this regex:

 

| rex "(?ms)\<Computer\>(?<Computer>[^\<]+).*\<Data Name\=\'SubjectUserName\'\>(?<SubjectUserName>[^\<]+).*\<Data Name\=\'TargetUserName\'\>(?<TargetUserName>[^\<]+).*\<Data Name\=\'TargetServerName\'\>(?<TargetServerName>[^\<]+).*\<Data Name\=\'ProcessId\'\>(?<ProcessId>[^\<]+).*\<Data Name\=\'ProcessName\'\>(?<ProcessName>[^\<]+).*\<Data Name\=\'IpAddress\'\>(?<IpAddress>[^\<]+).*"

 

that you can test at https://regex101.com/r/ljtkar/1

Ciao.

Giuseppe

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Pundittech,

could you share some sample of your data, highlighting the values to extract?

Ciao.

Giuseppe

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...