From 6bf38771c1613265c9b37916e2451ab96372af8d Mon Sep 17 00:00:00 2001 From: Aaron Mildenstein Date: Wed, 23 Apr 2014 16:23:30 -0500 Subject: [PATCH] =?UTF-8?q?It=20turns=20out=20that=20it=20would=20fail=20e?= =?UTF-8?q?very=20time=20if=E2=80=A6=20Consistent=20failure=20if=20I=20did?= =?UTF-8?q?n't=20put=20`next=20if=20typename.nil=3F`=20before=20the=20rest?= =?UTF-8?q?=20of=20the=20statement.=20=20This=20compromise=20puts=202=20`n?= =?UTF-8?q?ext=20if`=20statements,=20then=20an=20implied=20`else`=20since?= =?UTF-8?q?=20those=20were=20the=20two=20conditions=20I=20needed=20to=20ch?= =?UTF-8?q?eck=20:smile:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/logstash/codecs/collectd.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/logstash/codecs/collectd.rb b/lib/logstash/codecs/collectd.rb index fdb77b6e4..12bfcf1a2 100644 --- a/lib/logstash/codecs/collectd.rb +++ b/lib/logstash/codecs/collectd.rb @@ -120,10 +120,11 @@ class LogStash::Codecs::Collectd < LogStash::Codecs::Base @logger.info("Getting Collectd typesdb info", :typesdb => path.to_s) File.open(path, 'r').each_line do |line| typename, *line = line.strip.split - next if typename.nil? || if typename[0,1] != '#' # Don't process commented or blank lines - v = line.collect { |l| l.strip.split(":")[0] } - types[typename] = v - end + @logger.debug("typename", :typename => typename.to_s) + next if typename.nil? + next if typename[0,1] == '#' + v = line.collect { |l| l.strip.split(":")[0] } + types[typename] = v end end @logger.debug("Collectd Types", :types => types.to_s)