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!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...