Splunk Search

Referencing a json element- how do I convert "data" into a parsed json?

asafd
Explorer

Hi guys,

I'm trying to do something that I expected to be very simple, so I guess I'm missing something big.

This is my test SPL:

| makeresults 
| eval data=json_object("id", "123")| spath input=data| table data.id

I want to be able to refer to the data.id field, but I can't. how do I convert "data" into a parsed json?

 

TIA

Asaf

Labels (1)
0 Karma
1 Solution

chaker
Contributor

Hi @asafd 

Try this:


| makeresults
| eval data=json_object("id","123")| spath input=data
|multikv
|table id

View solution in original post

asafd
Explorer

It works!

Thanks @chaker.

 

0 Karma

chaker
Contributor

Hi @asafd 

Try this:


| makeresults
| eval data=json_object("id","123")| spath input=data
|multikv
|table id

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 ...