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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...