diff --git a/lib/splunk_logging.rb b/lib/splunk_logging.rb index 91a891040..39f58763f 100644 --- a/lib/splunk_logging.rb +++ b/lib/splunk_logging.rb @@ -11,7 +11,7 @@ module SplunkLogging if hash.respond_to?(:keys) string = '' hash.each_pair do |key, value| - if(value.instance_of?(Symbol)||value.instance_of?(Fixnum)) + if(value.instance_of?(Symbol)||value.instance_of?(Fixnum)||value.instance_of?(Float)) string << "#{key}=#{value} " else string << "#{key}='#{value}' " diff --git a/spec/lib/splunk_logging_spec.rb b/spec/lib/splunk_logging_spec.rb index f724ab641..f2fa5204f 100644 --- a/spec/lib/splunk_logging_spec.rb +++ b/spec/lib/splunk_logging_spec.rb @@ -17,5 +17,8 @@ describe SplunkLogging do it 'does not quote numbers' do format_hash({:key => 500 }).should =~ /=500/ end + it 'does not quote floats' do + format_hash({:key => 2.324}).should =~ /=2.324/ + end end end