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!

Transforming Financial Data into Fraud Intelligence

Every day, banks and financial companies handle millions of transactions, logins, and customer interactions ...

How to send events & findings from AWS to Splunk using Amazon EventBridge

Amazon EventBridge is a serverless service that uses events to connect application components together, making ...

Exciting News: The AppDynamics Community Joins Splunk!

Hello Splunkers,   I’d like to introduce myself—I’m Ryan, the former AppDynamics Community Manager, and I’m ...