Splunk Search

How to extract the field?

kiran331
Builder

How to extract the user(splunk) from the below field?

(ABCDEFG\splunk)

0 Karma
1 Solution

somesoni2
Revered Legend

Try this

your search | rex field=yourfield "\\\(?<user>\w+)\)"

Other methods

your search | eval user=replace(yourfield, "^.+\\\(\w+)\)","\1")

your search | eval user=rtrim(mvindex(split(yourfield,"\\"),-1),")")

View solution in original post

somesoni2
Revered Legend

Try this

your search | rex field=yourfield "\\\(?<user>\w+)\)"

Other methods

your search | eval user=replace(yourfield, "^.+\\\(\w+)\)","\1")

your search | eval user=rtrim(mvindex(split(yourfield,"\\"),-1),")")
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...