Module: LogStash::Filters

Defined in:
lib/logstash/namespace.rb,
lib/logstash/filters.rb

Defined Under Namespace

Classes: Base, Date, Field, Grep, Grok, Grokdiscovery, Multiline

Class Method Summary collapse

Class Method Details

.from_name(name, *args) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/logstash/filters.rb', line 5

def self.from_name(name, *args)
  # TODO(sissel): Add error handling
  # TODO(sissel): Allow plugin paths
  klass = name.capitalize

  # Load the class if we haven't already.
  require "logstash/filters/#{name}"

  # Get the class name from the Filters namespace and create a new instance.
  # for name == 'foo' this will call LogStash::Filters::Foo.new
  LogStash::Filters.const_get(klass).new(*args)
end