Created
May 8, 2014 19:44
-
-
Save nohtyp/4f60e6e829c9e13f3072 to your computer and use it in GitHub Desktop.
This fact will allow check of which version of splunk is installed.
This file contains hidden or 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
| #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