- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
can you create searches using the REST API in splunk cloud
adeyoyeniyi
New Member
08-29-2024
02:32 PM
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
akapa
Engager
09-18-2024
10:23 AM
Yes, you can create searches using the REST API in Splunk Cloud. Here are the basic steps:
- Get a Session Key: Authenticate with Splunk to get a session key.
- 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.
- 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.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
KendallW
Contributor
09-01-2024
08:44 PM
