Sha256: bded5acc8716272a157bae76ff4a758217d636315ca6d7492bf07e1e66291364
Contents?: true
Size: 897 Bytes
Versions: 112
Compression:
Stored size: 897 Bytes
Contents
# encoding: utf-8 require "logstash/namespace" require "logstash/config/grammar" require "logstash/config/config_ast" require "logstash/config/registry" require "logstash/errors" require "logger" class LogStash::Config::File include Enumerable attr_accessor :logger public def initialize(text) @logger = Cabin::Channel.get(LogStash) @text = text @config = parse(text) end # def initialize def parse(text) grammar = LogStashConfigParser.new result = grammar.parse(text) if result.nil? raise LogStash::ConfigurationError, grammar.failure_reason end return result end # def parse def plugin(plugin_type, name, *args) klass = LogStash::Plugin.lookup(plugin_type, name) return klass.new(*args) end def each @config.recursive_select(LogStash::Config::AST::Plugin) end end # class LogStash::Config::Parser #agent.config(cfg)
Version data entries
112 entries across 109 versions & 6 rubygems