Getting Data In

Display JSON as list, not table

DavidB
New Member

Hi,

I'm trying to create some test data which contains some JSON embedded in it. I'm then trying to extract the JSON and display it, which is working with the following search string:

 

 

| makeresults | eval _raw="018-07-13 05:48:30.343 PDT [pool-3-thread-3]  INFO STATUS - {\"well_formed_json\": \"yes\"}"
| rex field=_raw "INFO STATUS - (?<json>.*)"| rename json as _raw

 

 

However the results are displayed in a table. I'd like the results to be displayed in a list view with with color-coding,  nested levels, etc.

Is this possible? 

Labels (1)
0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

Is this what you are looking?

| makeresults 
| eval _raw="018-07-13 05:48:30.343 PDT [pool-3-thread-3] INFO STATUS - {\"well_formed_json\": \"yes\"}" | rex field=_raw "INFO STATUS - (?<json>.*)"| rex mode=sed "s/\\\//g" | spath input=json

R. Ismo 

0 Karma

DavidB
New Member

Hi Soutamo,

Thanks for the reply. Unfortunately that's not what I'm looking for. The results are still displayed in a table view.

 

I'm looking for the output to look like this:

json.PNG

0 Karma

bowesmana
SplunkTrust
SplunkTrust

The view you are showing is Splunk's raw event view - your example does not have an event as such, as it's constructed with makeresults and I don't believe you can leverage the event view without a real event

It is possible with real events inside a dashboard with the event visualisation, but I don't believe it's possible with constructed data - or for that matter with data from a lookup with inputlookup as that does not generate true events.

If you really needed this, I suspect you could construct your test data, then 'collect' it to an index and then search it with another search from that index.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...