lib/fluent/plugin/out_query_combiner.rb in fluent-plugin-querycombiner-0.0.0.pre vs lib/fluent/plugin/out_query_combiner.rb in fluent-plugin-querycombiner-0.0.1

- old
+ new

@@ -10,11 +10,11 @@ config_param :redis_retry, :integer, :default => 3 config_param :redis_key_prefix, :string, :default => 'query_combiner:' config_param :query_identify, :string, :default => 'session-id' config_param :query_ttl, :integer, :default => 1800 - config_param :buffer_size, :integer, :default => 100 + config_param :buffer_size, :integer, :default => 1000 config_param :flush_interval, :integer, :default => 60 config_param :remove_interval, :integer, :default => 10 config_param :tag, :string, :default => "query_combiner" @@ -34,11 +34,14 @@ @query_identify = @query_identify.split(',').map { |qid| qid.strip } # Create functions for each conditions @_cond_funcs = {} - @_replace_keys = {} + @_replace_keys = { + 'catch' => {}, + 'dump' => {}, + } def get_arguments(eval_str) eval_str.scan(/[\"\']?[a-zA-Z][\w\d\.\-\_]*[\"\']?/).uniq.select{|x| not (x.start_with?('\'') or x.start_with?('\"')) and \ not %w{and or xor not}.include? x @@ -86,9 +89,13 @@ raise Fluent::ConfigError, "`replace` configuration in #{element.name}: only allowed in `catch` and `dump`" end end } } + + if not (@_cond_funcs.has_key?('catch') and @_cond_funcs.has_key?('dump')) + raise Fluent::ConfigError, "Must have <catch> and <dump> blocks" + end end def has_all_keys?(record, argv) argv.each {|var| if not record.has_key?(var)