Getting Data In

python script return json, and show a table in search.

xuehui
New Member

I use python script to get json data thouth an API, and i want show them in a table in splunk search.
the python script used print(json) method, and the splunk used "|script ***" command.
but the splunk search result was only a part of json data(before ther first comma).
Why? and what should i do to show all json data in a table?
please help me,thanks.

0 Karma

woodcock
Esteemed Legend

Ideally splunk likes 100% true JSON which means NO SPACES. So make sure that your script does NOT output pretty JSON but true or compact JSON and Splunk should like it just fine. When Splunk presents it to you in search, it will pretty it for you then.

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...