class LogStash::Config::File

Attributes

logger[RW]

Public Class Methods

new(text) click to toggle source
# File lib/logstash/config/file.rb, line 14
def initialize(text)
  @logger = Cabin::Channel.get(LogStash)
  @text = text
  @config = parse(text)
end

Public Instance Methods

each() click to toggle source
# File lib/logstash/config/file.rb, line 34
def each
  @config.recursive_select(LogStash::Config::AST::Plugin)
end
parse(text) click to toggle source
# File lib/logstash/config/file.rb, line 20
def parse(text)
  grammar = LogStashConfigParser.new
  result = grammar.parse(text)
  if result.nil?
    raise LogStash::ConfigurationError, grammar.failure_reason
  end
  return result
end
plugin(plugin_type, name, *args) click to toggle source
# File lib/logstash/config/file.rb, line 29
def plugin(plugin_type, name, *args)
  klass = LogStash::Plugin.lookup(plugin_type, name)
  return klass.new(*args)
end