Splunk Search

"Page not found" when trying to search through REST API

dzkashlach
Engager

Hello everyone!

I receive "Page not found" message when I try to search using REST API.

My URL: [splunkhost]/en-US/services/search/jobs%20-d%20search="search%20index=enwiki""

Even such very common search gives nothing, although there is index=enwiki in system and I'm able to 

search in it through webui.

I was using https://docs.splunk.com/Documentation/Splunk/8.2.1/RESTTUT/RESTsearches

as a reference.

What should I check?

splunk-page-not-found.png

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

The examples in that document are for the command-line interface and won't work in a web browser.  When converting the examples for use in a browser, the part following "-d" goes in the body of a POST request.

---
If this reply helps you, Karma would be appreciated.

dzkashlach
Engager

Ok, thanks for tip.

One more moment:

curl -v -k --cookie "session_id_8080=session-id-value" http://host:port/en-US/services/search/jobs -d search="search *"

this one also gives me Page not found, although I'm taking cookie from valid session. 

I guess, I'm missing something in path ?

0 Karma
Get Updates on the Splunk Community!

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...