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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...