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 Webtools Add-on
SHA256 checksum (webtools-add-on_312.tgz) a3bef5bb73b9968fd69812f498d3d62b3935b8f84620454ed9eaec3939152c8c SHA256 checksum (webtools-add-on_311.tgz) 7df4a207a6ed5623092abcf94cfed2fd003b066df30a7f60ce89f9404fb8d1de SHA256 checksum (webtools-add-on_310.tgz) edf3f26682e2d4aa18a111184d37ce43cb275b8cd269e5f87a9cd0f4e23f989f SHA256 checksum (webtools-add-on_302.tgz) 92bcace6d291b84c1673dde9714f7fd16282c0411744e44c08849bc515e0192b SHA256 checksum (webtools-add-on_202.tgz) 17d027bbacce5983721c9bcc88bc23bf0eb864c944cb0961c02620a95f4a6983 SHA256 checksum (webtools-add-on_201.tgz) 347d3523e47c768ba58018dc07d42034ccb550da798b5dcd75b893a96a6cc9d0 SHA256 checksum (webtools-add-on_200.tgz) 31dfac8101fe7f8ebd2b63d6ff39a198086e43ffd98262bf272fad5568138321 SHA256 checksum (webtools-add-on_130.tgz) 22db0cf7031a241237af5af957908c151806f8839e798ccebc943626c7978a1a SHA256 checksum (webtools-add-on_126.tgz) bda39d148287a9ecbfd7f7dbaab2fc4b55761e3803a51b67115d1b04248ac5a8 SHA256 checksum (webtools-add-on_124.tgz) 16e786985c56f776c3773e6dae22e4178892b7163b968a6b10c02b54413d8174 SHA256 checksum (webtools-add-on_123.tgz) fdbe768fcff43e6c5e89bb8a19a3b60d5acfa18a6a246b7ec9a29d7d68d98437 SHA256 checksum (webtools-add-on_122.tgz) 19a255a5b4244f40f5b6bb48198c9dd72b2bdc059a39e01af5e9afcb2ce63142 SHA256 checksum (webtools-add-on_120.tgz) 3422e2754de66109ec276619ec4dfa15a2c51c3dc7eb92d5b40f6c84c5f07205 SHA256 checksum (webtools-add-on_110.tgz) 8986061e7d61e18fb99d9956481f267f47d8058b477c5fb56e721101c5c3f104 SHA256 checksum (webtools-add-on_100.tgz) 885b98703b9b6dedecda392aa617bb568523796253409c4eedda00feb203d0cf
To install your download
For instructions specific to your download, click the Details tab after closing this window.

Flag As Inappropriate

splunk

Webtools Add-on

Splunk Cloud
Overview
Details
This app is intended to solve the problem of connecting to external APIs/REST with Splunk Search. It allows you to use CURL inline with your other SPL and to URLENCODE as needed too.

IF YOU LIKE THIS APP, PLEASE LEAVE A RATING... TIA!!!

Source code is published at https://github.com/bentleymi/ta-webtools/ and version 3.0 is currently under the "cloud-version" branch of the repository.

I actively support my apps and am anxious to receive any feedback. Tag me on community.splunk.com or call use "contact the developer" to discuss via email.

-JKat54

IF YOU LIKE THIS APP, PLEASE LEAVE A RATING... TIA!!! Please tag me @jkat54 on community.splunk.com or call 1-844-4SPLUNK if you have any issues. I actively support my apps and am anxious to receive any feedback. -JKat54

Install Instructions:

Install app, restart splunk, profit!
If you want to use passwords in conjunction with the curl SPL command, you will want to install this app as well: https://splunkbase.splunk.com/app/4013/. It will allow you to store the passwords in the splunk password store (encrypted) and then use those credentials with the 'splunkpasswdname' and 'splunkpasswdcontext' curl command options.

curl command:

Syntax:

[optional:<generating_search>] | curl [choice: uri=uri OR urifield=urifield] [optional: method=<DELETE|GET|HEAD|PATCH|POST|PUT clientcert="/path/to/client/cert.pem" certkey="/path/to/client/cert.key" datafield=field_name data="data" headers=<JSON_STRING> headerfield=<JSON_FIELD> user="user" pass="password" debug=[true|false] splunkauth=[true|false] splunkpasswdname="username_in_passwordsconf" splunkpasswdcontext="appcontext" timeout=float sleep=timeInSecsBetweenCurls]

Examples:

  • GET data from uri, specifing user, pass, and very short timeout:
    | curl method=get uri=https://localhost:8089/services/admin user=admin pass=changeme timeout=0.001 | table curl*

  • GET data from uri, passing existing session key:
    | curl method=get uri=https://localhost:8089/services/admin splunkauth=true | table curl*

  • POST data to uri, specifying data="{\"name\":\"Test\",\"value\":\"Hello World\",\"severity\":\"warn\"}":
    | makeresults count=1
    | eval data="{\"name\":\"Test\",\"value\":\"Hello World\",\"severity\":\"warn\"}"
    | curl method=post uri=https://localhost:8089/services/messages/new splunkauth=true debug=true datafield=data
    | table curl*

  • POST data to uri, using a data field that exists in the Splunk search pipeline:
    | makeresults count=1
    | eval message="{\"name\":\"restart_link\",\"value\":\"Hello World\",\"severity\":\"warn\"}"
    | curl method=post uri=https://localhost:8089/services/messages/new datafield=message splunkauth=true
    | table curl*

  • Deleting fired alerts for search named "Test Alert":
    | rest /servicesNS/admin/search/alerts/fired_alerts/Test%20Alert
    | fields title
    | head 10
    | map search="
    | curl method=delete uri="https://localhost:8089/servicesNS/admin/search/alerts/fired_alerts/$title$" user=admin pass=changeme
    | table * "

  • Getting search results from google:
    | curl method=get uri=https://google.com/search?q=splunk debug=t

  • Getting multiple search results from google using data in the pipe:
    | makeresults count=2
    | eval data="q=".random()
    | curl method=get uri="https://google.com/search" datafield=data debug=true

  • Setting a Custom Header & Test Data:
    | makeresults count=1
    | eval header="{\"content-type\":\"application/json\"}"
    | eval data="{\"test data\":\"DATA\"}"
    | curl method=post uri=https://localhost:8089/services user=admin pass=changeme debug=true headerfield=header datafield=data

  • Call localhost but retrieve the password from the password store for username example (requires https://splunkbase.splunk.com/app/4013/)
    | curl method=get uri=https://localhost:8089/services user=example splunkpasswdname=example

  • Using the urifield option
    | makeresults count=1
    | eval uri="https://localhost:8089/services"
    | curl method=get urifield=uri

  • Getting list of vulnerabilities and parsing the results into something useable
    | curl uri="https://advisory.splunk.com/feed.xml"
    | fields curl_message
    | spath input=curl_message output=link path=rss.channel.item.link
    | mvexpand link
    | fields link
    | appendcols [
    | curl uri="https://advisory.splunk.com/feed.xml"
    | fields curl_message
    | spath input=curl_message output=title path=rss.channel.item.title
    | mvexpand title
    | fields title
    ]
    | appendcols [
    | curl uri="https://advisory.splunk.com/feed.xml"
    | fields curl_message
    | spath input=curl_message output=pubDate path=rss.channel.item.pubDate
    | mvexpand pubDate
    | fields pubDate
    ]
    | appendcols [
    | curl uri="https://advisory.splunk.com/feed.xml"
    | fields curl_message
    | spath input=curl_message output=description path=rss.channel.item.description
    | mvexpand description
    | fields description
    ]
    | eval pubDateE=floor(strptime(pubDate,"%a, %d %b %Y %T %z"))
    | map maxsearches=50 search="
    | makeresults count=1
    | fields - _time
    | eval uri=$link$
    | curl urifield=uri
    | fields curl_message uri
    | spath input=curl_message path=html.head.meta.meta.meta.meta.meta.meta.meta.meta.meta.link.body.div.div.div.article.section.div.div.div.table.tbody.tr.td output=affected
    | fields - curl_message
    | mvexpand affected
    | eval product=case(
    match(affected,\"Splunk Enterprise\"), \"Splunk Enterprise\",
    match(affected,\"Splunk Cloud\"), \"Splunk Cloud\",
    match(affected,\"Splunk Web\"), \"Splunk Web\",
    match(affected,\"Universal Forwarder\"), \"Universal Forwarder\",
    1=1, \"Undetected\"
    )
    | filldown product
    | rex field=affected \"^(?<lowerversions>\d+.\d+.\d+)\s\"
    | rex field=affected \"(\d+.\d+.\d+)\sto\s(?<upperversions>\d+.\d+.\d+)\"
    | where isnotnull(lowerversions)
    | eval upperversions=if(isnull(upperversions),lowerversions,upperversions)
    | eval lowerversions=if(match(affected,\"and [Llower|Bbelow]\"), lowerversions.\" and below\", lowerversions)
    "

urlencode command:

Syntax:

<generating_search> | urlencode <field_1> <field_2> <field_n> ... | table <field_1> <field_2> <field_n> ...

Release Notes

Version 3.1.2
Jan. 12, 2025

Version 3.1.2 -
- Bug Fix

Version 3.1.1
Dec. 27, 2024

Version 3.1.1
-Fixed 'data' variable when used with streaming capability
-Removed ability to specify user and pass with the command, use splunkpasswdname & splunkpasswdcontext OR token=<token> OR splunkauth=true instead.

Version 3.1.0
July 15, 2024

Version 3.1.0:
-Slimified
-Updates for friendlier self service cloud installs
-New ability to use Splunk Auth Tokens

Version 3.0.2
Aug. 16, 2022

Release Version 3.0.2:
- Enforcing HTTPS strings for URI
- Additional error handling and messaging

Version 2.0.2
Nov. 28, 2020

Version 2.0.2
-Added certificate support to curl command - https://github.com/bentleymi/ta-webtools/issues/8

Version 2.0.1
Nov. 28, 2020

Version 2.0.2
-Added sleep parameter - https://github.com/bentleymi/ta-webtools/issues/8

Version 2.0.0
Nov. 28, 2020

Version 2.0.0
-Ported from AOB2.x to AOB3.x
-Deprecated UDP on Modular Input
-Increased Timeout to 60 from 2 on Modular Input

Version 1.3.0
April 8, 2020

Version 1.3.0
- Added password store support for SPL curl command - Thanks @Gareth Anderson for the code
- Added 'urlfield' support as per request

Version 1.2.6
Oct. 8, 2019

Version 1.2.6:
- Fixed bug with POST & DELETE methods reported here: https://answers.splunk.com/answers/775943/huawei-esight-open-api-login-authentication-fails.html
- Many thanks to @infrastructure_Services_vwag_r_han_volkswagen_de!

Version 1.2.4
Aug. 2, 2019

Version 1.2.4:
- Removed UDP functionalities to pass new appinspect rules
- Fixed "bad operand" issue reported here: https://answers.splunk.com/answers/738867/web-tools-add-on-ta-webtools-curl-command-throws-a.html - Thanks @suser2019
- Cleaned up streaming logic

Version 1.2.3
Jan. 28, 2019

Release Version 1.2.3:
- Added HEAD method
- Changed GET method to use query parameters instead of data payloads
- Added curl_response_url to debug output

Version 1.2.2
Jan. 24, 2019

Release Version 1.2.2:
- Fixed bug in curl.py (curl spl command) that forced empty authentication parameters when authentication isnt required
- Thanks to @runner724 for reporting via answers - https://answers.splunk.com/answers/716585/webtools-app-how-to-make-get-without-basic-authent.html)

Version 1.2.0
Dec. 28, 2018

Release Version 1.2.0:
- Code readability improvements in curl.py
- Added 'timeout' option to curl command (as per request)
- Added exception handling to request functions in curl.py to support 'timeout' option

Version 1.1.0
Dec. 28, 2018

Release Version 1.1.0
- Made http method default to GET if not specified
- Added custom header capability to streaming curl command (by popular demand)
- Added curl_header to debug output of streaming curl command (by popular demand)
- Added curl_splunkauth to debug output of streaming & generating curl commands
- Added custom header capability to curl modular inputs (by popular demand)

Version 1.0.0
Aug. 24, 2018

Initial Release v1.0.0
- This was previously known as Splunk-TA_webtools, now it's been renamed to TA-webtools
- Now supports scripted inputs with the curl command
- Also added testport command for testing if TCP ports are open, and sending test UDP data for UDP tests


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.