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!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...