mirror of
https://github.com/elastic/logstash.git
synced 2025-04-23 22:27:21 -04:00
- add Event#to_hash
This commit is contained in:
parent
75dd74d398
commit
6805a6ef03
1 changed files with 9 additions and 5 deletions
14
lib/event.rb
14
lib/event.rb
|
@ -30,21 +30,25 @@ module LogStash; class Event
|
|||
|
||||
def [](key)
|
||||
return @data[key]
|
||||
end
|
||||
end # def []
|
||||
|
||||
def []=(key, value)
|
||||
@data[key] = value
|
||||
end
|
||||
end # def []=
|
||||
|
||||
def timestamp
|
||||
@data[:received_timestamp] or @data["received_timestamp"]
|
||||
end
|
||||
end # def timestamp
|
||||
|
||||
def source
|
||||
@data[:source] or @data["source"]
|
||||
end
|
||||
end # def source
|
||||
|
||||
def message
|
||||
@data[:message] or @data["message"]
|
||||
end
|
||||
end # def message
|
||||
|
||||
def to_hash
|
||||
return @data
|
||||
end # def to_hash
|
||||
end; end # class LogStash::Event
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue