Typically, to retrieve the download packages for the Universal Forwarder (UF), visit the link for the latest or previous version, log in with credentials, and manually search for the desired platform to obtain the download link or wget command.
However, in cases where automation is required, such as when using a script to retrieve the packages without human intervention, this manual process may not be viable. In these scenarios, an alternative command-line approach is best.
When automating the retrieval of Splunk Universal Forwarder packages, users typically download the latest or previous version manually via a browser. However, this method isn't suitable for automated processes, where downloading packages programmatically is needed.
The challenge is extracting the correct download links for the desired version, platform, architecture, and package type without manual intervention. This requires using tools like curl to scrape the download page and filter the relevant links.
A solution is to use a curl command that automatically retrieves the download links, which can be filtered based on individual needs.
To retrieve the latest Universal Forwarder release via command line, use the following curl command. This is designed to work on Linux systems:
curl https://www.splunk.com/en_us/download/universal-forwarder.html | grep -o -P 'data-link="[^"]+' | cut -c 12-
Expected Output:
This command will extract and display the download links for the latest Universal Forwarder release:
~$ curl https://www.splunk.com/en_us/download/universal-forwarder.html | grep -o -P 'data-link="[^"]+' | cut -c 12-
https://download.splunk.com/products/universalforwarder/releases/9.4.0/windows/splunkforwarder-9.4.0-251651b291fe-windows-x86.msi
https://download.splunk.com/products/universalforwarder/releases/9.4.0/windows/splunkforwarder-9.4.0-6b4ebe426ca6-windows-x64.msi
https://download.splunk.com/products/universalforwarder/releases/9.4.0/linux/splunkforwarder-9.4.0-251651b291fe.s390x.rpm
https://download.splunk.com/products/universalforwarder/releases/9.4.0/linux/splunkforwarder-9.4.0-251651b291fe-linux-s390x.tgz
https://download.splunk.com/products/universalforwarder/releases/9.4.0/linux/splunkforwarder-9.4.0-251651b291fe-linux-ppc64le.tgz
https://download.splunk.com/products/universalforwarder/releases/9.4.0/linux/splunkforwarder-9.4.0-251651b291fe.ppc64le.rpm
https://download.splunk.com/products/universalforwarder/releases/9.4.0/linux/splunkforwarder-9.4.0-6b4ebe426ca6-linux-amd64.deb
https://download.splunk.com/products/universalforwarder/releases/9.4.0/linux/splunkforwarder-9.4.0-6b4ebe426ca6.x86_64.rpm
For retrieving the previous Universal Forwarder releases, use a similar approach. Here's the curl command to retrieve download links for previous releases:
curl https://www.splunk.com/en_us/download/previous-releases-universal-forwarder.html | grep -o -P 'data-link="[^"]+' | cut -c 12- | grep 'version_number'
Replace 'version_number' with the specific version expected (e.g., 9.3.0).
Expected Output:
The command will return the download links for the specified version:
$ curl https://www.splunk.com/en_us/download/previous-releases-universal-forwarder.html | grep -o -P 'data-link="[^"]+' | cut -c 12- | grep '9.3.0'
0https://download.splunk.com/products/universalforwarder/releases/9.3.0/windows/splunkforwarder-9.3.0-51ccf43db5bd-x64-release.msi
https://download.splunk.com/products/universalforwarder/releases/9.3.0/windows/splunkforwarder-9.3.0-aa2a96a59f7e-x86-release.msi
https://download.splunk.com/products/universalforwarder/releases/9.3.0/linux/splunkforwarder-9.3.0-51ccf43db5bd.x86_64.rpm
https://download.splunk.com/products/universalforwarder/releases/9.3.0/linux/splunkforwarder-9.3.0-51ccf43db5bd-Linux-x86_64.tgz
https://download.splunk.com/products/universalforwarder/releases/9.3.0/linux/splunkforwarder-9.3.0-51ccf43db5bd-linux-2.6-amd64.deb
The command can be modified to suit the needs by filtering for specific platforms, architectures, or package types. Here are some examples:
curl https://www.splunk.com/en_us/download/universal-forwarder.html | grep -o -P 'data-link="[^"]+' | cut -c 12- | grep linux | grep x86 | grep rpm
2. Filter for Specific Architecture (e.g., x86_64):
curl https://www.splunk.com/en_us/download/universal-forwarder.html | grep -o -P 'data-link="[^"]+' | cut -c 12- | grep x86_64
3. Filter by Package Type (e.g., .tgz files):
curl https://www.splunk.com/en_us/download/universal-forwarder.html | grep -o -P 'data-link="[^"]+' | cut -c 12- | grep '.tgz'
By using these commands and modifications, users can automate the process of retrieving the necessary Universal Forwarder packages by platform and version requirements.
Community: How can I automate the downloading of universal forwarder?
| Revision | Publish Date | Comments |
|---|---|---|
1.0 |
29-Sep-2026
|
Initial Release |