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!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...