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>.*)"
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...