Splunk Search

How to parse JSON like-data with extracted server name as a column?

modulussplunk
Loves-to-Learn

Howdy

 

We've got this data:

 

Each log line is like:

{"serverX.somedom.com" : {"key.value.pair1": "0", "key.value.pair2": "1", "key.value.pair3": "2" }}

How can I access any of  key value pairs I want and  use the serverX.somedom.com  as well?

 

To produce something like:

 

|Server|key.value.pair1|key.value.pair2|Time|

|serverX.somedom.com|0|1|"time"

 

I've looked for lots of JSON and/or spath commands/post but I'm needing some more knowledge here..

 

Thanks!

 

 

 

Labels (2)
Tags (1)
0 Karma

modulussplunk
Loves-to-Learn

BTW, I could 'hack' this by using split and mvindex but that seems very hackish...like grep/sed/awk...I am trying to actually understand how to to this 'properly.

0 Karma
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

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

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...