Sha256: 897caab355f6436d12bade0fb1df866e02146918e2566ca2fbd4e9bce454f980

Contents?: true

Size: 543 Bytes

Versions: 11

Compression:

Stored size: 543 Bytes

Contents

require "logstash/namespace"
require "logstash/ruby_fixes"
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

11 entries across 11 versions & 1 rubygems

Version Path
logstash-lite-0.2.20101222161646 lib/logstash/inputs.rb
logstash-lite-0.2.20101208111718 lib/logstash/inputs.rb
logstash-lite-0.2.20101207114354 lib/logstash/inputs.rb
logstash-lite-0.2.20101201111523 lib/logstash/inputs.rb
logstash-lite-0.2.20101129210156 lib/logstash/inputs.rb
logstash-lite-0.2.20101129205551 lib/logstash/inputs.rb
logstash-lite-0.2.20101129155412 lib/logstash/inputs.rb
logstash-lite-0.2.20101124030048 lib/logstash/inputs.rb
logstash-lite-0.2.20101124004656 lib/logstash/inputs.rb
logstash-lite-0.2.20101123134625 lib/logstash/inputs.rb
logstash-lite-0.2.20101123133737 lib/logstash/inputs.rb