logstash-core/lib/logstash/plugins/registry.rb
# The legacy_lookup method uses the 1.5->5.0 file structure to find and match
# a plugin and will do a lookup on the namespace of the required class to find a matching
# plugin with the appropriate type.
The legacy_lookup method uses the 1.5->5.0 file structure to find and match
a plugin and will do a lookup on the namespace of the required class to find a matching
plugin with the appropriate type.
The legacy_lookup method uses the 1 . 5 - > 5 . 0 file structure to find and match a plugin and will do a lookup on the namespace of the required class to find a matching plugin with the appropriate type .
def legacy_lookup(type, plugin_name)
      begin
        path = "logstash/#{type}s/#{plugin_name}"
        begin
          require path
        rescue LoadError
        end
        klass = namespace_lookup(type, plugin_name)
        plugin = lazy_add(type, plugin_name, klass)
      rescue => e
        logger.error("Problems loading a plugin with",
                    :type => type,
                    :name => plugin_name,
                    :path => path,
                    :error_message => e.message,
                    :error_class => e.class,
                    :error_backtrace => e.backtrace)
        raise LoadError, "Problems loading the requested plugin named #{plugin_name} of type #{type}. Error: #{e.class} #{e.message}"
      end
      plugin
    end
def legacy_lookup ( type , plugin_name ) begin path = "logstash/#{type}s/#{plugin_name}" begin require path rescue LoadError end klass = namespace_lookup ( type , plugin_name ) plugin = lazy_add ( type , plugin_name , klass ) rescue => e logger . error ( "Problems loading a plugin with" , :type => type , :name => plugin_name , :path => path , :error_message => e . message , :error_class => e . class , :error_backtrace => e . backtrace ) raise LoadError , "Problems loading the requested plugin named #{plugin_name} of type #{type}. Error: #{e.class} #{e.message}" end plugin end
The legacy_lookup method uses the 1.5->5.0 file structure to find and match
a plugin and will do a lookup on the namespace of the required class to find a matching
plugin with the appropriate type.
The legacy_lookup method uses the 1 . 5 - > 5 . 0 file structure to find and match a plugin and will do a lookup on the namespace of the required class to find a matching plugin with the appropriate type .
# Plugin might be already defined in the current scope # This scenario often happen in test when we write an adhoc class
type
plugin_name