icon/x Created with Sketch.

Splunk Cookie Policy

We use our own and third-party cookies to provide you with a great online experience. We also use these cookies to improve our products and services, support our marketing campaigns, and advertise to you on our website and other websites. Some cookies may continue to collect information after you have left our website. Learn more (including how to update your settings) here.
Accept Cookie Policy

We are working on something new...

A Fresh New Splunkbase
We are designing a New Splunkbase to improve search and discoverability of apps. Check out our new and improved features like Categories and Collections. New Splunkbase is currently in preview mode, as it is under active development. We welcome you to navigate New Splunkbase and give us feedback.

Accept License Agreements

This app is provided by a third party and your right to use the app is in accordance with the license provided by that third-party licensor. Splunk is not responsible for any third-party apps and does not provide any warranty or support. If you have any questions, complaints or claims with respect to this app, please contact the licensor directly.

Thank You

Downloading Custom REST Command (crest)
SHA256 checksum (custom-rest-command-crest_300.tgz) 50dfc79033f627a9f9fa6a1cf6c748e9f29ab599af1af8d91e7e7131476326bc SHA256 checksum (custom-rest-command-crest_220.tgz) d985f377def33b097e383fcdcb19a551af3cedad2308a6c6969b78261cc049cb SHA256 checksum (custom-rest-command-crest_212-beta.tgz) 277e3c53b4ac5d889818dc3956778b3ab1cebab1980973eefc769e5601b2affd SHA256 checksum (custom-rest-command-crest_211-beta.tgz) 815a48913ef74e490dc8b8d40fe8de6e9a8898b7745a8e85296ce0dc961a52e4 SHA256 checksum (custom-rest-command-crest_201-beta.tgz) 5bed1a83544cc74f59e7c8ecdb8790ec82f1f6939fa802205bb4040dbfe4cc46 SHA256 checksum (custom-rest-command-crest_200-beta.tgz) 745740baee4f27140b04203bf35be8cd63fde17048eace8feda226098e2166f7
To install your download
For instructions specific to your download, click the Details tab after closing this window.

Flag As Inappropriate

splunk

Custom REST Command (crest)

Splunk Cloud
Overview
Details
The Custom REST Command (`crest`) app transforms your Splunk environment into a powerful, interactive API integration hub. Modern IT and security operations depend on data from countless external systems, but integrating this data is often a complex challenge requiring external scripts, middleware, or manual processes that kill productivity.

The `crest` command solves this by providing a seamless, feature-rich, and native way to send any HTTP request (`GET`, `POST`, `PUT`, `PATCH`, `DELETE`) directly from the Splunk search bar. This empowers you to not only fetch data but to automate actions, enrich events in real-time, and manage external systems without ever leaving the Splunk UI. Whether you're pulling threat intelligence, creating Jira tickets, updating a CMDB, or managing cloud resources, `crest` makes it simple, fast, and scalable.

### Why You Need This App

1. **Full API Interaction, Natively in Splunk:** Go beyond simple data fetching. With full support for `GET`, `POST`, `PUT`, `PATCH`, and `DELETE`, you can build complete, two-way integrations with any RESTful service.
2. **Automate and Enrich with Streaming Power:** Use `crest` in streaming mode to act on every event in a search result. With powerful token substitution (e.g., `url=".../users/$id$"`), you can dynamically update assets, enrich security events with external context, or automate responses at scale.
3. **Instantly Turn API Data into Splunk Tables:** Set `parse_response=true` to automatically convert messy API responses (JSON, CSV, XML) into clean, usable Splunk tables. The `json_path` parameter even lets you effortlessly extract data from deep within nested JSON structures.
4. **Simplified & Secure Authentication:** Forget complex header construction. Use the simple `auth_token` and `auth_type` parameters for easy Bearer, Basic, or other token-based authentication. The `verify_ssl=false` option provides flexibility for internal and test environments.
5. **Built for Control and Performance:** Avoid getting blocked by APIs with the built-in `delay` parameter for rate limiting in streaming mode. The robust `debug` mode lets you safely build and validate your requests before they ever leave Splunk.

By combining the analytical power of Splunk with direct, flexible API interaction, the Custom REST Command (`crest`) unlocks new possibilities for automation and data enrichment. Install it today to transform your data workflows into an agile, fully integrated system.

Custom REST Command (crest)

The crest command is a powerful and flexible custom Splunk search command that allows you to send HTTP requests directly from your Splunk searches.

It supports GET, POST, PUT, PATCH, and DELETE methods, allowing you to interact with RESTful APIs and web services. The command can run as a generating command (to start a search) or a streaming command (to act on existing results), making it a complete tool for API integration.

This command is shipped with the Custom REST Command app.

Table of Contents


Installation

To install the Custom REST Command app and use the crest command:

  1. Download the App: Obtain the app package from Splunkbase.
  2. Access Splunk Web: Log in to your Splunk instance.
  3. Navigate to Manage Apps:
    • Click on the Apps menu.
    • Select Manage Apps.
  4. Install the App:
    • Click on Install app from file.
    • Upload the app package.
    • Click Upload and follow the prompts.
  5. Restart Splunk: Some installations may require a restart. If prompted, restart your Splunk instance to complete the installation.

Syntax

| crest url=<string> method=<string> [data=<string>] [headers=<string>] [auth_token=<string>] [auth_type=<string>] [parse_response=<boolean>] [json_path=<string>] [delimiter=<string>] [verify_ssl=<boolean>] [delay=<float>] [timeout=<int>] [debug=<boolean>]
  • Note: Square brackets [] denote optional parameters.

Operating Modes

The crest command can operate in two distinct modes, depending on where it's placed in your SPL query.

1. Generating Mode

This mode is used when crest is the first command in your search (i.e., starts with | crest ...). It runs once to fetch data from an external source and bring it into Splunk.

Use Case: Importing a threat intelligence feed, fetching a list of users from an API, or checking the status of an external service.

2. Streaming Mode

This mode is used when crest is placed after another command (e.g., | makeresults ... | crest ... or index=_internal | ... | crest ...). It runs once for every event piped into it.

Use Case: This is extremely powerful. You can use it to create multiple tickets, update assets in a CMDB, or enrich events one by one. This mode enables Token Substitution.

Token Substitution

In streaming mode, you can use $field_name$ syntax in the url, data, and headers parameters to dynamically insert values from the incoming Splunk event.

  • Example: ... | eval user="admin", id=123 | crest url="https://api.local/users/$id$" data="{'name': '$user$'}"
  • Result: The command will make a request to https://api.local/users/123 with the payload {'name': 'admin'}.

Parameters

  • url (required): The endpoint URL to send the HTTP request to.
    • In Streaming Mode, supports token substitution (e.g., url=".../users/$id$").
  • method (required): The HTTP method to use.
    • Supported: get, post, put, patch, delete.
  • data (optional): The payload (body) to send with POST, PUT, or PATCH requests. This should be a string, typically formatted as JSON.
    • In Streaming Mode, supports token substitution (e.g., data="{'user': '$user_name$'}").
  • headers (optional): Custom headers to include in the request. Should be a JSON-formatted string (e.g., headers="{'X-API-Key': '123'}").
    • In Streaming Mode, supports token substitution.
  • auth_token (optional): A helper to easily add an Authorization header. This is the token string itself.
  • auth_type (optional): Specifies the type of token for auth_token.
    • Default: Bearer.
    • Supported: Bearer, Basic, Token. (e.g., auth_type="Basic" auth_token="dXNlcjpwYXNz...").
  • parse_response (optional): Set to true to automatically parse the API response into Splunk events (a table).
    • Default: false (returns a single event with status_code and status_message).
    • Supported formats: JSON (list of objects, or dict of objects), CSV, TSV (auto-detects delimiter), and XML.
  • json_path (optional): Used with parse_response=true for nested JSON. Specifies the key to find the list of results.
    • Example: If the response is {"count": 10, "results": [...] }, use json_path="results".
    • Supports dot notation for deeper nesting (e.g., json_path="data.items").
  • delimiter (optional): Used with parse_response=true. Forces a specific delimiter for CSV parsing (e.g., delimiter=";"). If not set, it auto-detects (comma, tab, semicolon, etc.).
  • verify_ssl (optional): Set to false to disable SSL certificate verification.
    • Default: true.
    • Warning: Only use verify_ssl=false in test environments or when you fully trust the endpoint (e.g., localhost with a self-signed cert).
  • delay (optional): The number of seconds to wait between requests in Streaming Mode. Useful for rate limiting.
    • Default: 0 (no delay).
    • Example: delay=0.5 (waits 500ms after each call).
  • timeout (optional): The number of seconds to wait for the server to respond.
    • Default: 10.
  • debug (optional): Set to true to return the request details (URL, headers, data) without executing the request.
    • Default: false.

Usage Examples

Example 1: Basic GET Request (Generating)

Fetches a simple GET request and returns the raw response.

| crest url="https://httpbin.org/get" method="get"

Result: A single event with status_code=200 and status_message containing the full JSON response.

Example 2: JSON Parsing (Generating)

Fetches a list of public APIs from an open API and parses the JSON response into a table.

| crest url="https://api.apis.guru/v2/list.json" method="get" parse_response=true

Result: A table of thousands of APIs. The json_parent_key column shows the API name, and other columns (added, preferred) are populated from the response.

Example 3: Nested JSON Parsing (Generating)

Fetches a list of public APIs, but this time the list is nested inside a key named "entries".

| crest url="https://api.publicapis.org/entries" method="get" parse_response=true json_path="entries"

Result: A table of APIs with columns like API, Category, and Link. Using json_path is crucial here.

Example 4: CSV Parsing (Generating)

Fetches a threat intelligence feed in CSV format and automatically parses it into a table. The command will auto-detect the comma delimiter and skip the # comment lines.

| crest url="https://hole.cert.pl/domains/v2/domains.csv" method="get" parse_response=true

Result: A table of malicious domains with columns like hostname, ip, and classification.

Example 5: Token Authentication

Sends an authenticated request using the simple auth_token helper.

| crest url="https://httpbin.org/bearer" method="get" auth_token="my-secret-token-123"

Result: A single event. The status_message will show "authenticated": true and "token": "my-secret-token-123".

Example 6: Streaming Mode with Token Substitution

Creates three new tickets in an external system by piping events into crest. This demonstrates token substitution and the delay parameter for rate limiting.

| makeresults count=3
| streamstats count
| eval ticket_title = "Ticket " + count, user_email = "user" + count + "@example.com"
| crest url="https://api.my-helpdesk.com/v1/tickets" method="post" \
    data="{'summary': '$ticket_title$', 'requester': '$user_email$', 'status': 'new'}" \
    auth_token="my-api-key" \
    delay=1

Result: This runs 3 times.
1. POSTs to /v1/tickets with {'summary': 'Ticket 1', 'requester': 'user1@example.com', ...}
2. Waits 1 second.
3. POSTs to /v1/tickets with {'summary': 'Ticket 2', 'requester': 'user2@example.com', ...}
4. Waits 1 second.
5. ...and so on. The search results will show 3 events, each with the status_code of its respective API call.


Debug Mode

Use the debug=true parameter to see what the command would send. This is essential for troubleshooting token substitution, headers, and data formatting.

| makeresults
| eval user="matheus", ticket_id=55
| crest url="https://api.local/tickets/$ticket_id$" method="put" \
    data="{'assignee': '$user$'}" \
    auth_token="123" \
    debug=true

Result: A single event with fields showing the final values:
- debug_url: https://api.local/tickets/55
- debug_data: {'assignee': 'matheus'}
- debug_headers: {'Authorization': 'Bearer 123'}
- debug_method: put


Notes

  • HTTPS Enforcement: By default, the command requires https:// for all URLs except localhost.
  • SSL Verification: SSL verification is enabled by default. If you are querying an internal endpoint with a self-signed certificate, you must use verify_ssl=false.
  • Localhost Session Auth: When making requests to localhost (e.g., the local Splunk REST API), the command automatically includes your Splunk session key in the Authorization header. You will likely need to use verify_ssl=false as well.
    • spl | crest url="https://localhost:8089/services/authentication/current-context" method="get" verify_ssl=false parse_response=true
  • Timeouts: The default timeout is 10 seconds. You can increase this with the timeout parameter for long-running API calls.
  • Data Payloads: When writing JSON for data and headers, you must use single quotes for the outer string and double quotes for the inner keys and values, as required by Splunk's SPL parser.
    • Correct: data='{"user":"matheus","role":"admin"}'
    • Incorrect: data="{\"user\":\"matheus\",\"role\":\"admin\"}" (This is valid but difficult to read and escape)
  • Empty Responses (204 No Content): The command correctly handles successful but empty responses (like 204 No Content) and will not produce a parsing error.

License

This app is licensed under the MIT License.


Disclaimer: Use this command responsibly. Make sure you have permission to access the URLs you are querying, and be aware of the load and security implications of sending HTTP requests from your Splunk instance.

Release Notes

Version 3.0.0
Oct. 16, 2025

Release Notes: Custom REST Command (crest) v3.0.0

Release Date: October 16, 2025

This is a major feature release that significantly enhances the power, flexibility, and robustness of the crest command. The command has been almost entirely rewritten to address user feedback and introduce professional-grade features for API integration within Splunk.

New Features

Expanded HTTP Method Support: The command now supports PUT and PATCH methods in addition to GET, POST, and DELETE, enabling full RESTful interaction with APIs.

Simplified Authentication: Two new parameters, auth_token and auth_type, have been added to streamline authentication. Users can now easily add Bearer, Basic, or other token types without manually constructing a JSON header.

Nested JSON Parsing (json_path): A new json_path parameter allows the parser to extract and unn-est data from deep within a JSON response (e.g., json_path="results.data"), making it immensely more powerful for complex APIs.

SSL Certificate Control (verify_ssl): A boolean parameter verify_ssl has been added to allow users to disable SSL certificate verification. This is essential for interacting with internal development environments or services using self-signed certificates.

Rate Limiting Control (delay): In streaming mode, the new delay parameter can be used to introduce a pause (in seconds) between each API request, preventing rate-limiting errors from target APIs.

Improvements

Dual-Mode Operation: The command is now explicitly designed and tested to work flawlessly in both Generating Mode (| crest ...) and Streaming Mode (... | crest ...), resolving the core issue from previous versions.

Advanced Response Parsing (parse_response):

JSON: The parser now intelligently handles multiple JSON structures: lists of objects, dictionaries of objects (like the apis.guru endpoint), and single objects.

CSV/TSV: The parser now automatically detects the delimiter (comma, semicolon, tab, etc.) using sniffing and correctly ignores comment lines (starting with #). A delimiter override is also available.

Token Substitution in Streaming Mode: The command now fully supports replacing $field_name$ tokens in the url, data, and headers parameters with values from incoming Splunk events.

Robust Error Handling: The command now correctly handles 204 No Content success codes without raising a parsing error. Error messages for SSL failures and other common issues have also been improved.

Localhost Authentication: The logic to automatically inject the user's Splunk session token for localhost API calls has been restored and improved.

Version 2.2.0
Jan. 31, 2025
  • Removed the ability to change the SSL verification parameter to improve security and ensure consistent enforcement of SSL settings.
  • Updated global configurations for write access to application knowledge objects.
Version 2.1.2-beta
Nov. 22, 2024

Stopped loading data option as JSON. Leaving as String.

Version 2.1.1-beta
Nov. 22, 2024

Debug mode fixed.

Version 2.0.1-beta
Nov. 22, 2024

README update.

Version 2.0.0-beta
Nov. 22, 2024

Custom REST Command (crest)

The crest command is a custom Splunk search command that allows you to send HTTP requests directly from your Splunk searches. It supports GET, POST, and DELETE methods, allowing you to interact with RESTful APIs and web services within your Splunk environment.

This command is shipped with the Custom REST Command app.

Table of Contents


Installation

To install the Custom REST Command app and use the crest command:

  1. Download the App: Obtain the app package from Splunkbase.
  2. Access Splunk Web: Log in to your Splunk instance.
  3. Navigate to Manage Apps:
    • Click on the Apps menu.
    • Select Manage Apps.
  4. Install the App:
    • Click on Install app from file.
    • Upload the app package.
    • Click Upload and follow the prompts.
  5. Restart Splunk: Some installations may require a restart. If prompted, restart your Splunk instance to complete the installation.

Syntax

| crest url=<string> method=<string> [data=<string>] [headers=<string>] [debug=<boolean>] [verify=<boolean>] [timeout=<int>]

  • Note: Square brackets [] denote optional parameters.

Parameters

  • url (required): The endpoint URL to send the HTTP request to.
  • method (required): The HTTP method to use. Supported methods are get, post, and delete.
  • data (optional): The payload to send with a POST request. Should be a JSON-formatted string.
  • headers (optional): Custom headers to include in the request. Should be a JSON-formatted string.
  • debug (optional): Set to true to enable debug mode, which displays request details without executing the request.
  • verify (optional): Set to false to disable SSL verification in your REST calls. Be careful with this option!
  • timeout (optional): Default is 10s, but you can change it according to your needs..

Usage

Example 1: GET Request

Send a GET request to http://example.com/api.

| crest url="http://example.com/api" method="get"

Explanation: This command sends a GET request to the specified URL and returns the response data in the search results.

Example 2: POST Request

Send a POST request with a data payload to http://example.com/api.

| crest url="http://example.com/api" method="post" data="{'key':'value'}"

Explanation: This command sends a POST request to the specified URL with the provided JSON data as the payload.

Example 3: DELETE Request

Send a DELETE request to http://example.com/api/resource.

| crest url="http://example.com/api/resource" method="delete"

Explanation: This command sends a DELETE request to remove the specified resource at the given URL.


Debug Mode

Use the debug parameter to display the request details without executing the actual HTTP request. This is useful for verifying the request configuration.

| crest url="http://example.com/api" method="get" debug="true"

Explanation: When debug is set to true, the command outputs the request details (such as url, method, headers, and data) without sending the HTTP request.


Notes

  • SSL Verification: SSL verification is enabled by default. Ensure that your Splunk instance can verify the SSL certificates of the endpoints you are accessing. If you need to disable SSL verification (not recommended due to security risks), you can include the option verify="false" in the command.
  • Session Authorization: When making requests to localhost, the command automatically includes the Splunk session key in the Authorization header. This uses your user to authenticate the internal request.
  • Timeouts: The command uses a default timeout of 10 seconds for HTTP requests. You can change this using the timeout option if necessary.
  • Error Handling: The command includes error handling for network problems and invalid parameters.
  • Data Payloads: When sending JSON data in the data and header parameters, make sure it is properly formatted. For example:
    • data="{\"user\":\"matheus\",\"role\":\"admin\"}"

License

This app is licensed under the MIT License.


Disclaimer: Use this command responsibly. Make sure you have permission to access the URLs you are querying, and be aware of the load and security implications of sending HTTP requests from your Splunk instance.


Subscribe Share

Are you a developer?

As a Splunkbase app developer, you will have access to all Splunk development resources and receive a 10GB license to build an app that will help solve use cases for customers all over the world. Splunkbase has 1000+ apps from Splunk, our partners and our community. Find an app for most any data source and user need, or simply create your own with help from our developer portal.

Follow Us:
Splunk, Splunk>,Turn Data Into Doing, Data-to-Everything, and D2E are trademarks or registered trademarks of Splunk LLC in the United States and other countries. All other brand names,product names,or trademarks belong to their respective owners.