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.
To install the Custom REST Command app and use the crest command:
| 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>]
[] denote optional parameters.The crest command can operate in two distinct modes, depending on where it's placed in your SPL query.
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.
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.
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.
... | eval user="admin", id=123 | crest url="https://api.local/users/$id$" data="{'name': '$user$'}"https://api.local/users/123 with the payload {'name': 'admin'}.url (required): The endpoint URL to send the HTTP request to.url=".../users/$id$").method (required): The HTTP method to use.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.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'}").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.Bearer.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).false (returns a single event with status_code and status_message).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.{"count": 10, "results": [...] }, use json_path="results".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.true.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.0 (no delay).delay=0.5 (waits 500ms after each call).timeout (optional): The number of seconds to wait for the server to respond.10.debug (optional): Set to true to return the request details (URL, headers, data) without executing the request.false.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.
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.
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.
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.
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".
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.
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
https:// for all URLs except localhost.verify_ssl=false.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=truetimeout parameter for long-running API calls.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.data='{"user":"matheus","role":"admin"}'data="{\"user\":\"matheus\",\"role\":\"admin\"}" (This is valid but difficult to read and escape)204 No Content) and will not produce a parsing error.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: 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.
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.
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.
Stopped loading data option as JSON. Leaving as String.
Debug mode fixed.
README update.
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.
To install the Custom REST Command app and use the crest command:
| crest url=<string> method=<string> [data=<string>] [headers=<string>] [debug=<boolean>] [verify=<boolean>] [timeout=<int>]
[] denote optional 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..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.
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.
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.
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.
verify="false" in the command.localhost, the command automatically includes the Splunk session key in the Authorization header. This uses your user to authenticate the internal request.data and header parameters, make sure it is properly formatted. For example:data="{\"user\":\"matheus\",\"role\":\"admin\"}"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.
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.