Splunk Search

How to extract the field?

Builder

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

(ABCDEFG\splunk)

0 Karma
1 Solution

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

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

State of Splunk Careers

Access the Splunk Careers Report to see real data that shows how Splunk mastery increases your value and job satisfaction.

Find out what your skills are worth!