Getting Data In

How to parse json file to create a table for application usage.

gbatye
New Member

Hello,

I have the following data in a json file:

Format is application: days since last used.

{
"AdobePhotoshop": "34",
"VmWareFusion": "6"
}

I want to create a table that counts the number of machines within a given time range that looks something like this:

Application     usage last 7 days       usage 7-30   usage 30-90   usage over 90-
AdobePhoto                 4                            1                    5                      0
VmWareFusion             6                            5                    0                      1

Any ideas? Also does it make sense to store the data in a json format or is there a better option? Thanks!

Tags (2)
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

I'd prefer to store the data in JSON with standardized field names, something like this:

{"Applications": [
  {"Name": "AdobePhotoshop", "DaysSinceLastUse", "34"},
  {"Name": "VmWareFusion", "DaysSinceLastUse", "6"}
]}

That makes using the data very easy, you could extract the fields using spath or the appropriate props.conf settings (I think indexed_extractions = JSON), and run very easy statistics over the values, e.g. splitting by app name. Adding further properties to an application object is very simple to do here.

As your data is now, using the JSON field name makes the following search pipeline extremely clumsy, if at all feasible. It'd likely be better to regex those fields from there than relying on the JSON field names. Basically, this is no real object structure (the O in JSON).

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!

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

Index This | How many sevens are there between 1 and 100?

August 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...