Contains source code for TA-webtools Splunk Add-on
The curl command allows you to make HTTP requests from within Splunk searches.
uri: The HTTPS URL to send the request tourifield: Field name containing the HTTPS URL to send the request to
method: HTTP method to use (default: get)- Supported values: get/g, head/h, patch, post/p, put, delete/del/d
datafield: Field name containing the data payload to senddata: Static data payload to senddebug: Enable debug output (true/false)splunkauth: Use Splunk authentication (true/false)splunkpasswdname: Username from passwords.conf to use for authenticationsplunkpasswdcontext: App context for passwords.conf lookup (default: -)timeout: Request timeout in seconds (default: 60)token: Bearer token for authenticationheaders: JSON string containing request headersheaderfield: Field containing JSON formatted request headersclientcert: Path to client certificate filecertkey: Path to certificate key filesleep: Time to sleep between requests in seconds (when processing multiple events)proxy: Proxy URL to use for requestsproxy_auth: Proxy authentication in format username:password
- All URIs must use HTTPS protocol
- SSL verification is enforced for Splunk Cloud compatibility
The command adds the following fields to your events:
curl_status: HTTP status code of the responsecurl_message: Response body or error message
When debug=true, additional fields are added showing the command configuration:
curl_method: HTTP method usedcurl_verifyssl: SSL verification statuscurl_uri: Request URLcurl_splunkauth: Whether Splunk authentication was usedcurl_data_payload: Data payload sent (if any)curl_header: Headers used (if any)curl_cert: Client certificate path (if used)curl_certkey: Certificate key path (if used)curl_sleep: Sleep duration between requests (if configured)
| makeresults
| eval url="https://api.example.com/data"
| curl uri=url method=get
The urlencode command allows you to URL encode field values within your Splunk searches. This is useful when preparing values for use in URLs or API calls.
The command takes field names as arguments and updates the contents to be URL encoded values.
| makeresults
| eval my_field="hello world 123"
| urlencode my_field
This will update the value of my_field to hello%20world%20123