mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
- fix bug: actually yield events on decode
- convert @foo names to just 'foo'
This commit is contained in:
parent
b24d4cab8f
commit
b5a71c9ce6
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue