Splunk Enterprise Security

Splunk Search from Command Line

sumitp
New Member

Hi,
I am trying to execute a simple Splunk search from command prompt using CURL.
I am using a simple search command like this below
curl -u username:password -k splunkhost:8089/services/search/jobs -d search='search *'

I am receiving this response
<response>
<messages>
<msg type='WARN'>insufficient permission to access this resource</msg>
</messages>
</response>

Am I missing out some permissions?

Tags (1)
0 Karma

lkutch_splunk
Splunk Employee
Splunk Employee

Your syntax looks correct based on the docs: 
https://docs.splunk.com/Documentation/Splunk/8.1.1/RESTTUT/RESTsearches#Example:_Create_a_search

Are you using an on-prem instance or a  cloud instance? There might be some access requirements and limitations: 
https://docs.splunk.com/Documentation/Splunk/latest/RESTTUT/RESTandCloud 

0 Karma
Get Updates on the Splunk Community!

The All New Performance Insights for Splunk

Splunk gives you amazing tools to analyze system data and make business-critical decisions, react to issues, ...

Good Sourcetype Naming

When it comes to getting data in, one of the earliest decisions made is what to use as a sourcetype. Often, ...

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...