Splunk Search

splunk restful service not working

kml_uvce
Builder

I am trying to get restful service from splunk

curl -k -u username:password -k https:///services/search/jobs -d search="index=neteng|head 5"

I am getting this error.
<?xml version='1.0' encoding='UTF-8'?>
Search operation 'index' is unknown. You might not have permission to run this operation.

But I have the permission to run/view in web splunk.

kamal singh bisht
Tags (2)
0 Karma

Ayn
Legend

You need to specify the "search" command at the start of the search parameter. When you run searches in the web UI, the search command is implicitly added at the start, however when interacting directly with the REST API it is not.

So, the modification needed to make this work should be:

curl -k -u <username:password> -k https://<splunk server="">/services/search/jobs -d search="search index=neteng|head 5"
Get Updates on the Splunk Community!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...