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!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...