Splunk Search

Please help! How to use REX to extract the values

splunknewbie123
New Member

Can someone please help me with this?

I just start using splunk and I cannot figure out this, what I need is to extract the guestid in this example:

"http_body": "{\"data\":{\"guest\":{\"profileStatus\":\"A\",\"guestId\":123456789

Thanks in advance.

Tags (1)
0 Karma

493669
Super Champion

Try Below rex command-

|makeresults|eval _raw="\"http_body\": \"{\"data\":{\"guest\":{\"profileStatus\":\"A\",\"guestId\":123456789"|rex "guestId\\\":(?<a>\d+)"

For testing you can use https://regex101.com/

0 Karma
Get Updates on the Splunk Community!

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

New Release | Splunk Cloud Platform 10.1.2507

Hello Splunk Community!We are thrilled to announce the General Availability of Splunk Cloud Platform 10.1.2507 ...

🌟 From Audit Chaos to Clarity: Welcoming Audit Trail v2

&#x1f5e3; You Spoke, We Listened  Audit Trail v2 wasn’t written in isolation—it was shaped by your voices.  In ...