Sha256: 76ec7900d83e5ee2a9890ef6429b0c5b0ae1225c10daf7934b5398802fc66927

Contents?: true

Size: 513 Bytes

Versions: 5

Compression:

Stored size: 513 Bytes

Contents

require "logstash/namespace"
require "uri"

module LogStash::Inputs
  def self.from_url(url, type, &block)
    # Assume file paths if we start with "/"
    url = "file://#{url}" if url.start_with?("/")

    uri = URI.parse(url)
    # TODO(sissel): Add error handling
    # TODO(sissel): Allow plugin paths
    klass = uri.scheme.capitalize
    file = uri.scheme
    require "logstash/inputs/#{file}"
    LogStash::Inputs.const_get(klass).new(uri, type, &block)
  end # def from_url
end # module LogStash::Inputs

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
logstash-lite-0.2.20101120024757 lib/logstash/inputs.rb
logstash-lite-0.2.20101120021802 lib/logstash/inputs.rb
logstash-lite-0.2.20101119183130 lib/logstash/inputs.rb
logstash-lite-0.2.20101118141920 lib/logstash/inputs.rb
logstash-lite-0.2.20101118134500 lib/logstash/inputs.rb