Last active
August 29, 2015 14:01
-
-
Save discreet/bd9f06a1e7f85fdd9fb7 to your computer and use it in GitHub Desktop.
Splunk Universal Forwarder Version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This fact will pull the Splunk Universal Forwarder version and then normalize it so you can use versioncmp in Puppet to update your Splunk Universal Forwarders. | |
#Splunk Universal Forwarder Version | |
Facter.add("SplunkUF_Version") do | |
confine :osfamily => "RedHat" | |
setcode do | |
SplunkUF_Version = Facter::Util::Resolution.exec("/opt/splunkforwarder/bin/splunk --version | awk {'print $4'}") | |
if SplunkUF_Version.length < 5 | |
while SplunkUF_Version.length < 5 do | |
SplunkUF_Version.insert(-1, '.0') | |
end | |
end | |
SplunkUF_Version | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment