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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...