Skip to content

Commit 8782f35

Browse files
committed
logstash-plugins#7 Filter support added
1 parent cca3d28 commit 8782f35

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/logstash/inputs/couchdb_changes.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class LogStash::Inputs::CouchDBChanges < LogStash::Inputs::Base
3030
# Required parameter.
3131
config :db, :validate => :string, :required => true
3232

33+
# The CouchDB filter parameter
34+
config :filter, :validate => :string
35+
3336
# Connect to CouchDB's _changes feed securely (via https)
3437
# Default: false (via http)
3538
config :secure, :validate => :boolean, :default => false
@@ -176,6 +179,7 @@ def run(queue)
176179
def build_uri
177180
options = {:feed => FEED, :include_docs => INCLUDEDOCS, :since => @sequence}
178181
options = options.merge(@timeout ? {:timeout => @timeout} : {:heartbeat => @heartbeat})
182+
options = options.merge(@filter ? {:filter => @filter} : {})
179183
URI::HTTP.build(:scheme => @scheme, :host => @host, :port => @port, :path => @path, :query => URI.encode_www_form(options))
180184
end
181185

0 commit comments

Comments
 (0)