- fix bug: actually yield events on decode

- convert @foo names to just 'foo'
This commit is contained in:
Jordan Sissel 2013-08-24 23:56:49 -07:00
parent b24d4cab8f
commit b5a71c9ce6

View file

@ -14,11 +14,12 @@ class LogStash::Codecs::OldLogStashJSON < LogStash::Codecs::Base
basics = %w(@timestamp @message @source_host @source_path @source
@tags @type)
basics.each do |key|
h[key] = obj[key] if obj.include?(key)
# Convert '@message' to 'message', etc
h[key[1..-1]] = obj[key] if obj.include?(key)
end
h.merge!(obj["@fields"]) if obj["@fields"].is_a?(Hash)
event = LogStash::Event.new(h)
yield LogStash::Event.new(h)
end # def decode
public