Splunk Search

Help me with Rex in search query

sravankaripe
Communicator

"sessionID":"123456567"
"sessionID":"ABCnsh8ah"

Please help me with Rex to pick
123456567
ABCnsh8ah

from above _raw event

0 Karma
1 Solution

koshyk
Super Champion

Please try

<raw_search> | rex  "sessionID\":\"(?<mysessionID>[\d\w]+)\""| table mysessionID

Full example with sample data

|makeresults | eval _raw="\"sessionID\":\"123456567\""|  rex  "sessionID\":\"(?<mysessionID>[\d\w]+)\""| table mysessionID

View solution in original post

0 Karma

hhGA
Communicator

Hi,

Give this a shot:

rex field=_raw> "\"sessionID\":\"(?<field>\S+)\""
0 Karma

adayton20
Contributor

Try this:

| rex field=_raw "sessionID\"\:\"(<sessionID>.[^\"]*)"
0 Karma

koshyk
Super Champion

Please try

<raw_search> | rex  "sessionID\":\"(?<mysessionID>[\d\w]+)\""| table mysessionID

Full example with sample data

|makeresults | eval _raw="\"sessionID\":\"123456567\""|  rex  "sessionID\":\"(?<mysessionID>[\d\w]+)\""| table mysessionID
0 Karma
Get Updates on the Splunk Community!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...