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!

From Data to Insight: Announcing the Winners of the Splunk Dashboard Contest

Hi Splunkers, First off, thank you to everyone who participated in our very first From Data to Insight: The ...

Splunk Developers: Construct Your Future at the .conf26 Builder Bar

Calling all Splunk architects, platform admins, and app developers: the site is open, and the blueprints are ...

Quick connection discovery mode for forwarders

When a Splunk forwarder loses connectivity to its indexers, it does not always reconnect immediately. In many ...