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!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...