Skip to content

Instantly share code, notes, and snippets.

@jfeilbach
Created April 8, 2019 20:11
Show Gist options
  • Save jfeilbach/f2e28b6c20cf2d3ca5a92e20c8bfdb44 to your computer and use it in GitHub Desktop.
Save jfeilbach/f2e28b6c20cf2d3ca5a92e20c8bfdb44 to your computer and use it in GitHub Desktop.
Get splunk universal forwarder download URL
#!/bin/bash
#URL="https://www.splunk.com/en_us/download/splunk-enterprise.html"
URL="https://www.splunk.com/en_us/download/universal-forwarder.html"
OS_REGEX="linux-2\.6-x86_64\.rpm"
#OS_REGEX="Linux-x86_64\.md5"
RESPONSE=`curl -s --connect-timeout 10 --max-time 10 $URL`
LINK=`echo $RESPONSE | egrep -o "data-link=\"https://[^\"]+-${OS_REGEX}\"" | cut -c12- | rev | cut -c2- | rev`
echo $LINK
#wget --no-check-certificate -P /tmp $LINK
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment