Couchdb_changes plugin and logstash 5.0.1


(Dr Rob) #1

Hi,

The couchdb_changes plugin doesn't work in logstash 5.0.1. I installed it to CentOS 7 from the RPM repository. The error message says:

Error: Direct event field references (i.e. event['field']) have been disabled in favor of using event get and set methods (e.g. event.get('field')). Please consult the Logstash 5.0 breaking changes documentation for more details.

I think I've been able to fix it by doing this:

$ diff -C5 /usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-couchdb_changes-3.1.0/lib/logstash/inputs/couchdb_changes.rb.orig /usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-couchdb_changes-3.1.0/lib/logstash/inputs/couchdb_changes.rb
*** /usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-couchdb_changes-3.1.0/lib/logstash/inputs/couchdb_changes.rb.orig	2016-11-18 18:16:17.556230665 -0500
--- /usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-couchdb_changes-3.1.0/lib/logstash/inputs/couchdb_changes.rb	2016-11-18 18:16:24.437669664 -0500
***************
*** 175,185 ****
                  next if changes.chomp.empty?
                  if event = build_event(changes)
                    @logger.debug("event", :event => event.to_hash_with_metadata) if @logger.debug?
                    decorate(event)
                    queue << event
!                   @sequence = event['@metadata']['seq']
                    @sequencedb.write(@sequence.to_s)
                  end
                end
              end
            end
--- 175,185 ----
                  next if changes.chomp.empty?
                  if event = build_event(changes)
                    @logger.debug("event", :event => event.to_hash_with_metadata) if @logger.debug?
                    decorate(event)
                    queue << event
!                   @sequence = event.get("[@metadata][seq]")
                    @sequencedb.write(@sequence.to_s)
                  end
                end
              end
            end

HTH,
Rob.


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.