Getting Data In

Is it possible to get warnings via REST API when using JSON?

JeanA
New Member

Hi,

We recently had a temporary problem with a license configuration which produced warnings when searching in the Splunk UI.

Running the same search via the REST API and using output_mode set to 'json' while the warnings were still unresolved resulted in an empty result set ("[]") response rather than any type of error or warning. The search I was running normally would have returned two results.

I ran the same search using the default XML output_mode and the same warnings that were in the UI showed up in the XML as <msg type="WARN"> elements.

Is there a way to get the warnings to show up in the JSON output which is considerably easier to parse (I'm using Python)? We resolved the cause of the warnings but I don't want to rely on JSON output if it ignores warnings and acts the same as if there were no matches to the search.

Thanks in advance!
--jean

Tags (2)
0 Karma

Ayn
Legend

I don't think you will get these warning messages as part of requests to other endpoints than the ones that specifically will give you this information. The ones I imagine would be of relevance to you are:

Get Updates on the Splunk Community!

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 ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...