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!

Splunk Search APIを使えば調査過程が残せます

   このゲストブログは、JCOM株式会社の情報セキュリティ本部・専任部長である渡辺慎太郎氏によって執筆されました。 Note: This article is published in both Japanese ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

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