Splunk Search

Splunk returns zero results using REST API

kvmadan
Explorer

I'm trying to search a query and retrieve the results through REST API, and it returns zero results. Below queries, i am using to submit the search, check the status of the dispatch, and retrieve the results.

https://splunk.corp.net:8089/servicesNS/admin/search/search/jobs

https://splunk.corp.net:8089/services/search/jobs/{{sid}}?output_mode=json

https://splunk.corp.net:8089/services/search/jobs/{{sid}}/results

The same query executed from the Splunk UI, returns the results. Also, the UI returns results in a fraction of second, but in case of REST API, it takes more than ~5 minutes to complete the search (dispatchState = DONE) and returns zero results.

Its is the same case for any search i do with REST API.

Any idea, what am I doing wrong here?

Tags (4)
0 Karma

manjunathmeti
SplunkTrust
SplunkTrust

Can you post code snippet doing post call to /search/jobs?

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...