Dashboards & Visualizations

Extract json array to tabular format with their values

nithys
Communicator

Hi 

I have an event which has prod and test based on env...if it is test it goes to nsps [{},{} ] object an check for the name say A,B,C,D an get their associate  ReadOnlyConsumerNames in tabular format

Output as:

Name      ReadOnlyConsumerNames 
A               Application, Lst,data

B               Application, Lst

C             Lst

D            Lst,Gt,PT

 

 

 

{ [-]

   prod: { []

   }

   test: { [-]

     DistinctAdminConsumers: [ [-]

       App

       pd.

     ]

     DistinctAdminUser: 2

     DistinctReadConsumers: [ [-]

       Application.

       GT.

       Technology.

       data

     ]

     DistinctReadUser: 4

     TotalAdminUser: 20

     TotalNSPCount: 10

     TotalReadUsers: 13

     nsps: [ [-]

       { [-]

         AdminConsumerNames: [ [-]

           App.

           pd.

         ]

         AdminUserCount: 2

         Name: A

         ReadOnlyConsumerNames: [ [-]

           Application

           Lst

           data

         ]

         ReadonlyUserCount: 3

       }

       { [-]

         AdminConsumerNames: [ [-]

           App

           Data

         ]

         AdminUserCount: 2

         Name: B

         ReadOnlyConsumerNames: [ [-]

           Application

           Lst

         ]

         ReadonlyUserCount: 3

       }

       { [-]

         AdminConsumerNames: [ [-]

           preprod

           pd

         ]

         AdminUserCount: 2

         Name: C

         ReadOnlyConsumerNames: [ [-]

           Lst

         ]

         ReadonlyUserCount: 1

       }

       { [-]

         AdminConsumerNames: [ [+]

         ]

         AdminUserCount: 2

         Name: D

         ReadOnlyConsumerNames: [ [-]

           Lst

           Gt

           PT

         ]

         ReadonlyUserCount: 1

       }

  

     ]

   }

}

 

 

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| spath test.nsps{} output=nsps
| mvexpand nsps
| spath input=nsps Name output=Name
| spath input=nsps ReadOnlyConsumerNames{} output=ReadOnlyConsumerNames
| table Name ReadOnlyConsumerNames
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Kick the Tires Before You Commit: A Hands-On Tour of the Splunk Observability Cloud ...

Evaluating an enterprise observability platform usually goes like this: fill out a form, get a free trial with ...

Deep insights, no barriers: Splunk Observability Cloud Free Edition

As software delivery cycles continue to accelerate, observability shouldn’t be a luxury — it should be a ...

Monitoring AI Agents with Splunk Observability Cloud

Let’s say I’m running a travel planning AI app in production. A user asks for three concise hotel options in ...