lib/logstash/inputs/puppet_facter.rb in logstash-input-puppet_facter-0.1.4 vs lib/logstash/inputs/puppet_facter.rb in logstash-input-puppet_facter-0.1.5
- old
+ new
@@ -1,9 +1,9 @@
# encoding: utf-8
require "logstash/inputs/base"
require "logstash/namespace"
-require "json"
+require "logstash/json"
# Connects to a puppet server and requests facts
class LogStash::Inputs::PuppetFacter < LogStash::Inputs::Base
config_name "puppet_facter"
@@ -66,11 +66,11 @@
rescue
logger.error("Unable to retrieve from host " + @host + " port " + @port.to_s() + " at uri " + uri)
raise
end
begin
- data = JSON.parse(response.body)
+ data = LogStash::Json.load(response.body)
rescue
logger.error("Unable to parse cert status response")
raise
end
hostList = []
@@ -85,10 +85,10 @@
rescue
logger.warn("Unable to retrieve from host " + @host + " port " + @port.to_s() + " at uri " + uri)
next
end
begin
- data = JSON.parse(response.body)["values"]
+ data = LogStash::Json.load(response.body)["values"]
rescue
logger.warn("Unable to parse response from facts for node " + host)
next
end
for key, value in data