Splunk Search

REST API output_mode='json' causes client search error responses to be suppressed

phoellig
New Member

I've been working with the /services/search/jobs/export API recently and I noticed that setting the output mode to 'json' can cause responses to be suppressed. Here's an example:

 

curl -u $USER:$PASSWORD -k https://<splunk>/services/search/jobs/export -d search='search=savedsearch "my_search"'
<?xml version='1.0' encoding='UTF-8'?>
<response><messages><msg type="FATAL">Error in 'search' command: Unable to parse the search: Comparator '=' is missing a term on the left hand side.</msg></messages></response>

 

This same request in a different output mode has no response content.

 

curl -u $USER:$PASSWORD -k https://splunk.drwholdings.com:8089/services/search/jobs/export -d search='search=savedsearch "my_search"' -d "output_mode=json"

 

Is there some other flag I need to set to have these errors come through in JSON mode? Requests that don't result in error responses return fine. Both requests come back with status code 200.

Tags (4)
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...