Skip to content

Instantly share code, notes, and snippets.

@nohtyp
Created May 8, 2014 19:44
Show Gist options
  • Select an option

  • Save nohtyp/4f60e6e829c9e13f3072 to your computer and use it in GitHub Desktop.

Select an option

Save nohtyp/4f60e6e829c9e13f3072 to your computer and use it in GitHub Desktop.
This fact will allow check of which version of splunk is installed.
#Splunk Universal Forwarder Version
Facter.add("SplunkUF_Version") do
setcode do
SplunkUF_Version = Facter::Util::Resolution.exec("/opt/splunkforwarder/bin/splunk --version | awk {'print $4'}")
if SplunkUF_Version.length < 6
while SplunkUF_Version.length < 10 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