Splunk Search

How to extract the field "user" from my data?

kiran331
Builder

Hi

How to extract the field "user" from the following data?

ABCDEFGHI\cw2343@ac.abcdefghi.com

ABCDEFGHI\kirann@ac.abcdefghi.com

ABCDEFGHI\12kirAN@ac.abcdefghi.com

I need to extract

user:
cw2343
kirann
12kirAN
0 Karma
1 Solution

sundareshr
Legend

Try this for rex

... | rex "\\(?<user>[^@]+)" | table user

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

\\(?<user>[^@]+)

---
If this reply helps you, Karma would be appreciated.

richgalloway
SplunkTrust
SplunkTrust

Sundareshr beat me to it again.

---
If this reply helps you, Karma would be appreciated.

sundareshr
Legend

Try this for rex

... | rex "\\(?<user>[^@]+)" | table 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 ...