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_302.tgz) 76d5137031521d01975bd6763d8ea7ec54a7dee58ec92e0db99dc6c3ea54165f SHA256 checksum (webtools-add-on_202.tgz) f2eb14323aaffec0c429dc8334bc3d312178d924ef205efb1a9c1c81ff5e32c0 SHA256 checksum (webtools-add-on_201.tgz) ba16cfc4a5d44b47c6cab2594ba92c8696ce3d7c19ec040c6b452c11d24e2926 SHA256 checksum (webtools-add-on_200.tgz) f715087e92c205ae340155b3d78565ff1cca6e603fd878b665bf83fc7693e3a1 SHA256 checksum (webtools-add-on_130.tgz) bac503eaf61a80fabb8b9b0af725b0d3aa8fb6489276d3119d75bd2e45eef058 SHA256 checksum (webtools-add-on_126.tgz) da4f9c68ff7aabe7e17efeb2d78eb7c5f8e051296cc379ef4b91a61d0fcf78bc SHA256 checksum (webtools-add-on_124.tgz) e3e3f452daccae02f6a574e165c93989985bd5fd8c30a44d3324d4db8537637b SHA256 checksum (webtools-add-on_123.tgz) 99790ef7915cdf8921cb7749d022fcd8a28c95af061de3957508147fa7c7fa51 SHA256 checksum (webtools-add-on_122.tgz) 5e0c89f943bde6d093c753c7743698368a15e67a146c6193bc10b7712082e87b SHA256 checksum (webtools-add-on_120.tgz) ae63224d5d84cfea3739132c33cdf003ef79bf95fc088bd892d3ddc899951048 SHA256 checksum (webtools-add-on_110.tgz) e56e1097ea061fc07e9938395d5b91261f6112324f709e6623497997895e2bd7 SHA256 checksum (webtools-add-on_100.tgz) 4c80be6ac3aaf17405967e52a9cc3872985498494233de3dce2ad78e5e3aec36
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.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 Inc. in the United States and other countries. All other brand names,product names,or trademarks belong to their respective owners.