Dashboards & Visualizations

Rex command

prasant
Path Finder

Need help to extract value between 2 fields eg: below

"status":"Active",
"birthDate":"xxxx-03-06",

I am trying below

rex field=details "\"status\"\:\"(?<contactStatus>[^\n\r\",]+)*\"birthDate\""

NOTE: there is another status field, so I am trying to use this option, as I know "birthDate " follows "status" field.

Thanks for you help in advance

Tags (1)
0 Karma

prasant
Path Finder

Thanks,,, I used below "\"status\":\"(?<contactStatus>[^\n\r\"]*)\",\"birthDate\"", it also worked.

0 Karma

bowesmana
SplunkTrust
SplunkTrust

User (?s) for matching newline by . character. Try this

| makeresults
| eval details="\"status\":\"Active\",
\"birthDate\":\"xxxx-03-06\",
\"status\":\"otherstatus\""
| rex field=details "(?s)\"status\"\:\"(?<contactStatus>[^\"]*).+\"birthDate\""
Get Updates on the Splunk Community!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...