Class: LogStash::Config::File
- Inherits:
-
Object
- Object
- LogStash::Config::File
- Includes:
- Enumerable, Util::Loggable
- Defined in:
- lib/logstash/config/file.rb
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(text) ⇒ File
constructor
A new instance of File.
-
#parse(text) ⇒ Object
def initialize.
-
#plugin(plugin_type, name, *args) ⇒ Object
def parse.
Methods included from Util::Loggable
included, #logger, #slow_logger
Constructor Details
permalink #initialize(text) ⇒ File
Returns a new instance of File.
13 14 15 16 |
# File 'lib/logstash/config/file.rb', line 13 def initialize(text) @text = text @config = parse(text) end |
Instance Method Details
permalink #each ⇒ Object
[View source]
32 33 34 |
# File 'lib/logstash/config/file.rb', line 32 def each @config.recursive_select(LogStash::Config::AST::Plugin) end |
permalink #parse(text) ⇒ Object
def initialize
18 19 20 21 22 23 24 25 |
# File 'lib/logstash/config/file.rb', line 18 def parse(text) grammar = LogStashConfigParser.new result = grammar.parse(text) if result.nil? raise LogStash::ConfigurationError, grammar.failure_reason end return result end |
permalink #plugin(plugin_type, name, *args) ⇒ Object
def parse
27 28 29 30 |
# File 'lib/logstash/config/file.rb', line 27 def plugin(plugin_type, name, *args) klass = LogStash::Plugin.lookup(plugin_type, name) return klass.new(*args) end |