Splunk Enterprise

Parsing by regex

ymalm188
Explorer

i need to parse this field   duser=DOMAIN\\User to only extract user without Domain\\

Labels (1)
0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

you can start with this with your actual data.

| makeresults 
| eval duser="DOMAIN\\\\User"
| rex field=duser "(?<=\\\\)(?<user>\w+)"

Probably you need to adjust the amount of \-characters?

See: https://regex101.com/r/6YF8BQ/1

r. Ismo 

ymalm188
Explorer

i tried this and worked duser=Domain\\+(?<duser>\S+)

 

thank you

Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| rex field=duser "\\\\\\\\(?<user>.*)"
Get Updates on the Splunk Community!

.conf23 | Get Your Cybersecurity Defense Analyst Certification in Vegas

We’re excited to announce a new Splunk certification exam being released at .conf23! If you’re going to Las ...

Streamline Data Ingestion With Deployment Server Essentials

REGISTER NOW!Every day the list of sources Admins are responsible for gets bigger and bigger, often making the ...

Remediate Threats Faster and Simplify Investigations With Splunk Enterprise Security ...

REGISTER NOW!Join us for a Tech Talk around our latest release of Splunk Enterprise Security 7.2! We’ll walk ...