Splunk Cloud Platform

can you create searches using the REST API in splunk cloud

adeyoyeniyi
New Member

can you create searches using the REST API in splunk cloud

Labels (1)
0 Karma

akapa
Engager

Yes, you can create searches using the REST API in Splunk Cloud. Here are the basic steps:

  1. Get a Session Key: Authenticate with Splunk to get a session key.
  2. Create a Search Job: Use the /services/search/jobs endpoint to create a search job. You’ll need to send a POST request with your search query in the body.
  3. Check Search Status: Use the search ID (sid) returned from the previous step to check the status of your search job.

Here’s a simple example using curl:

curl -k -u username:password https://<splunk-cloud-url>/services/search/jobs -d search="search index=_internal | head 10"

This command will create a search job that retrieves the first 10 events from the _internal index.

 
 
0 Karma

KendallW
Contributor
0 Karma
Get Updates on the Splunk Community!

Take Your Breath Away with Splunk Risk-Based Alerting (RBA)

WATCH NOW!The Splunk Guide to Risk-Based Alerting is here to empower your SOC like never before. Join Haylee ...

SignalFlow: What? Why? How?

What is SignalFlow? Splunk Observability Cloud’s analytics engine, SignalFlow, opens up a world of in-depth ...

Federated Search for Amazon S3 | Key Use Cases to Streamline Compliance Workflows

Modern business operations are supported by data compliance. As regulations evolve, organizations must ...