Splunk Search

How to extract a key and value from the json data?

hrs2019
Path Finder

Hi all, I am not able to extract the below-given value from the JSON file
fields are

"initiator": test_abce,
"releasenumber":0.0.11,
"source": "test420",
"deployenv": testppt,
"ServiceMD": app
"ServiceManager": app1
"ServiceLead": app2

Ialt text

I am attaching the screenshot for more information there is space i thing that is causing the issue i tried to add the field name also in my query like source name......... releasenumber source |table releasenumber source deployenv ServiceMD ServiceManager

Am not able to list the data which all are in yellow color

JSON File.
{
"Pirid" : 7965,
"url": "https://connects.test.com/home",

"id": 88,
"level": "202",
"guideline": "2.4",
"help": {
"description": "testid"
},
"pagestest1" : 0,
"pagestest2": 0,
"pagestest3": 1,
"principle": 2,
"severity": "review",
"success_criterion": "2.4.10",
"initiator": test_abce,
"releasenumber":0.0.11,
"source": "test420",
"deployenv": testppt,
"ServiceMD": app
"ServiceManager": app1
"ServiceLead": app2
"success_criterion_title": "Section",
"more_details": "https://api.test",
"ApplicationNm": "Connects",
"_links": {
"pages": {
"href": "https://api/pages"
},
"progress": {
"history": {
"pages": "https://api./history"
}
}
}
}

Labels (2)
0 Karma

reed_kelly
Contributor

Did you try putting all values in quotes. Also some values are missing the subsequent comma ",". Can you fix the input data to be more like this?

"initiator": "test_abce",
"releasenumber":"0.0.11",
"source": "test420",
"deployenv": "testppt",
"ServiceMD": "app",
"ServiceManager": "app1",
"ServiceLead": "app2",
0 Karma

hrs2019
Path Finder

@reed.kelly Thanks for your help

Actually the data is already index in Splunk and I can't modify the JSON file.
I want to use the existing data and try to fetch the filed name with that output.
is there is any way?
I can list the data till "success_criterion" but after that, I can't

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...