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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

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 GA in US-AWS!

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