Sha256: ead24120d695d8b68c3017082100ffd2e3ffe105b5bfbc704f3dab9264d51064

Contents?: true

Size: 830 Bytes

Versions: 105

Compression:

Stored size: 830 Bytes

Contents

# encoding: utf-8
require "logstash/namespace"
require "logstash/config/grammar"
require "logstash/config/config_ast"
require "logstash/errors"
require "logger"

class LogStash::Config::File
  include Enumerable
  include LogStash::Util::Loggable

  public
  def initialize(text)
    @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

105 entries across 102 versions & 11 rubygems

Version Path
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/logstash-core-5.6.4-java/lib/logstash/config/file.rb