<commit_before>require 'find'
Facter.add(:splunk_version) do
  confine :kernel => :linux
  setcode do
    command = ''
    path = ['/opt/splunk','/opt/splunkforwarder']
    path.each do |directory|
      Find.find(directory) do |file|
        command << file if !File::directory?(file) and File.executable?(file) and file =~ /.*\/splunk$/
      end
    end
    if command != ''
      version = Facter::Util::Resolution.exec("#{command} version")
    elsif command == ''
      version = Facter::Util::Resolution.exec('splunk version')
    end
    if version
      version.match(/\d+\.\d+\.\d+/).to_s
    else
      nil
    end
  end
end<commit_msg>Updated version string matching to allow 2 and 3 digit version numbers<commit_after>require 'find'
Facter.add(:splunk_version) do
  confine :kernel => :linux
  setcode do
    command = ''
    path = ['/opt/splunk','/opt/splunkforwarder']
    path.each do |directory|
      Find.find(directory) do |file|
        command << file if !File::directory?(file) and File.executable?(file) and file =~ /.*\/splunk$/
      end
    end
    if command != ''
      version = Facter::Util::Resolution.exec("#{command} version")
    elsif command == ''
      version = Facter::Util::Resolution.exec('splunk version')
    end
    if version
      version.match(/[\d+\.]+\s/).to_s
    else
      nil
    end
  end
end
{'fraction_non_alphanumeric': 0.15281899109792285, 'fraction_numerical': 0.001483679525222552, 'mean_word_length': 2.7576601671309193, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6585164', 'n_tokens_mistral': 435, 'n_tokens_neox': 433, 'n_words': 106}