Splunk Search

rex command help

sravankaripe
Communicator

Help me with Rex

"keys":"values"

"SSOUSERDATA":"INDV=12345678|ONE|testd44|ABCD,ABCD_ABCDABCD"
"X-comGlobalSessionID":"Abcdef2OtOEWYEX0TA6B1KQ"
"X-comPrimaryIdentity":"12345678"
"X-comImpersonatedIdentity":"12345678"
"msgContentType":"Exception due to so and so"

Tags (1)
0 Karma

jkat54
SplunkTrust
SplunkTrust

...|extract kvdelim=":" pairdelim=" "

If that works in search, it can be done automatically in props.conf too

skoelpin
SplunkTrust
SplunkTrust

This would be the obvious choice, but OP said he wanted rex

skoelpin
SplunkTrust
SplunkTrust

How about this?

... | rex \":\"(?<skoelpin>.+)(?=\")

Your fieldname will be skoelpin 🙂

0 Karma

sravankaripe
Communicator

i want to retrive "INDV=12345678|ONE|testd44|ABCD,ABCD_ABCDABCD"
from the event. can you help me with rex.

"SSOUSERDATA":"INDV=12345678|ONE|testd44|ABCD,ABCD_ABCDABCD"

0 Karma

skoelpin
SplunkTrust
SplunkTrust

This will capture the value "INDV=12345678|ONE|testd44|ABCD,ABCD_ABCDABCD"

... | rex \":\"(?<skoelpin>.+)(?=\")

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

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, ...