mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
- Enhance testability
This commit is contained in:
parent
2a1bd53121
commit
99791282b4
2 changed files with 9 additions and 1 deletions
|
@ -4,7 +4,7 @@ require "uri"
|
|||
|
||||
# General event type. Will expand this in the future.
|
||||
module LogStash; class Event
|
||||
def initialize(data)
|
||||
def initialize(data=Hash.new)
|
||||
@cancelled = false
|
||||
@data = {
|
||||
"@source" => "unknown",
|
||||
|
|
|
@ -22,6 +22,14 @@ class LogStash::Filters::Date < LogStash::Filters::Base
|
|||
@types = Hash.new { |h,k| h[k] = [] }
|
||||
end # def initialize
|
||||
|
||||
def add_config(type, typeconfig)
|
||||
if @config.include?(type)
|
||||
@config[type].merge!(typeconfig)
|
||||
else
|
||||
@config[type] = typeconfig
|
||||
end
|
||||
end
|
||||
|
||||
def register
|
||||
@config.each do |type, typeconfig|
|
||||
@logger.debug "Setting type #{type.inspect} to the config #{typeconfig.inspect}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue