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!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...