lib/fluent/plugin/out_couch.rb in fluent-plugin-couch-0.3.3 vs lib/fluent/plugin/out_couch.rb in fluent-plugin-couch-0.3.5
- old
+ new
@@ -10,10 +10,11 @@
config_param :database, :string
config_param :host, :string, :default => 'localhost'
config_param :port, :string, :default => '5984'
+ config_param :protocol, :string, :default => 'http'
config_param :refresh_view_index , :string, :default => nil
config_param :user, :string, :default => nil
config_param :password, :string, :default => nil
@@ -30,14 +31,14 @@
def configure(conf)
super
end
def start
- super
+
if @user && @password
- @db = CouchRest.database!("http://#{@user}:#{@password}@#{@host}:#{@port}/#{@database}")
+ @db = CouchRest.database!("#{@protocol}://#{@user}:#{@password}@#{@host}:#{@port}/#{@database}")
else
- @db = CouchRest.database!("http://#{@host}:#{@port}/#{@database}")
+ @db = CouchRest.database!("#{@protocol}://#{@host}:#{@port}/#{@database}")
end
@views = []
if @refresh_view_index
begin
@db.get("_design/#{@refresh_view_index}")['views'].each do |view_name,func|