Splunk Dev

field extract help

valpravin
Engager

payload : {"nodeId":34567,"cycleCode":10}
someone please help me in how to extract nodeID

i tried like this :

rex field=_raw "\"nodeId\"\s:\s(?P)"

Tags (1)
0 Karma

vnravikumar
Champion

Hi

Try this

| makeresults 
| eval temp="payload : {\"nodeId\":34567,\"cycleCode\":10}" 
| rex field=temp "payload\s:\s\{\"nodeId\"\:(?P<nodeId>[^,]+)"

or

| makeresults 
| eval temp="payload : {\"nodeId\":34567,\"cycleCode\":10}" 
| rex field=temp "payload\s:\s\{\"nodeId\"\:(?P<nodeId>\d+)"
0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...