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!

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...

Get ready to show some Splunk Certification swagger at .conf24!

Dive into the deep end of data by earning a Splunk Certification at .conf24. We're enticing you again this ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Now On-Demand Join us to learn more about how you can leverage Service Level Objectives (SLOs) and the new ...