Splunk® Enterprise

Search Reference

Download manual as PDF

Splunk Enterprise version 6.x is no longer supported as of October 23, 2019. See the Splunk Software Support Policy for details. For information about upgrading to a supported version, see How to upgrade Splunk Enterprise.
This documentation does not apply to the most recent version of Splunk. Click here for the latest version.
Download topic as PDF


The rest command reads a Splunk Enterprise REST API endpoint and return the resource data as a search result.

For more information, see the REST API Reference Manual.


rest <rest-uri> [count=<int>] [splunk_server=<string>] [timeout=<int>] (<get-arg-name>=<get-arg-value>)...

Required arguments

Syntax: <uri>
Description: URI path to the Splunk REST API endpoint.
Syntax: <string>
Description: REST argument name.
Syntax: <string>
Description: REST argument value.

Optional arguments

Syntax: count=<int>
Description: Limits the number of results returned. When count=0, there is no limit.
Default: 0
Syntax: splunk_server=<string>
Description: Limits the results to one specific server. Use "local" to refer to the search head.
Syntax: timeout=<int>
Description: Specify the timeout in seconds when waiting for the REST endpoint to respond.
Default: 60


Example 1: Access saved search jobs.

| rest /services/search/jobs count=0 splunk_server=local | search isSaved=1

Example 2: Add current search user to all events (useful for creating reports that only show events associated with logged in user).

* | head 10 | join [ | rest splunk_server=local /services/authentication/current-context | rename username as auth_user_id | fields auth_user_id ]


Have questions? Visit Splunk Answers and see what questions and answers the Splunk community has about using the rest command.

Last modified on 11 June, 2015

This documentation applies to the following versions of Splunk® Enterprise: 6.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.0.6, 6.0.7, 6.0.8, 6.0.9, 6.0.10, 6.0.11, 6.0.12, 6.0.13, 6.0.14, 6.0.15, 6.1, 6.1.1, 6.1.2, 6.1.3, 6.1.4, 6.1.5, 6.1.6, 6.1.7, 6.1.8, 6.1.9, 6.1.10, 6.1.11, 6.1.12, 6.1.13, 6.1.14, 6.2.13, 6.2.14, 6.2.15

Was this documentation topic helpful?

Enter your email address, and someone from the documentation team will respond to you:

Please provide your comments here. Ask a question or make a suggestion.

You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters