376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
|
# File 'lib/logstash/config/config_ast.rb', line 376
def compile
type = recursive_select_parent(PluginSection).first.plugin_type.text_value
if type == "filter"
i = LogStash::Config::AST.defered_conditionals_index += 1
source = <<-CODE
def cond_func_#{i}(input_events)
result = []
input_events.each do |event|
events = [event]
#{super}
end
result += events
end
result
end
CODE
LogStash::Config::AST.defered_conditionals << source
<<-CODE
events = cond_func_#{i}(events)
CODE
else
<<-CODE
#{super}
end
CODE
end
end
|