tgermain / logstash-filter-docker_metadata

A logstash filter to add metadata to docker logs
Other
0 stars 2 forks source link

Issue with Hashie #2

Open m4ce opened 8 years ago

m4ce commented 8 years ago

Hi,

I tried to use your filter with logstash 2.1.1 unsuccessfully. It fails with the following errors:

SystemStackError: stack level too deep
                each at org/jruby/RubyArray.java:1613
            convert! at /opt/logstash/vendor/bundle/jruby/1.9/gems/hashie-3.4.3/lib/hashie/extensions/indifferent_access.rb:78
             inject! at /opt/logstash/vendor/bundle/jruby/1.9/gems/hashie-3.4.3/lib/hashie/extensions/indifferent_access.rb:61
   indifferent_value at /opt/logstash/vendor/bundle/jruby/1.9/gems/hashie-3.4.3/lib/hashie/extensions/indifferent_access.rb:86
  indifferent_writer at /opt/logstash/vendor/bundle/jruby/1.9/gems/hashie-3.4.3/lib/hashie/extensions/indifferent_access.rb:107
              filter at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-docker_metadata-0.1.5/lib/logstash/filters/docker_metadata.rb:92
        multi_filter at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.1-java/lib/logstash/filters/base.rb:151
                each at org/jruby/RubyArray.java:1613
        multi_filter at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.1-java/lib/logstash/filters/base.rb:148
         filter_func at (eval):41
        filterworker at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.1-java/lib/logstash/pipeline.rb:244
       start_filters at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.1-java/lib/logstash/pipeline.rb:178

Changing the following line fixes the issue for me.

      event["docker"] = DockerHash.new

to

      event["docker"] = {}

Cheers, Matteo

m4ce commented 8 years ago
{:timestamp=>"2016-01-15T15:17:42.750000+0100", :message=>"Exception in filterworker, the pipeline stopped processing new events, please check your filter configuration and restart Logstash.", "exception"=>#<SystemStackError: stack level too deep>, "backtrace"=>["org/jruby/RubyArray.java:1613:in `each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/hashie-3.4.3/lib/hashie/extensions/indifferent_access.rb:78:in `convert!'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/hashie-3.4.3/lib/hashie/extensions/indifferent_access.rb:61:in `inject!'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/hashie-3.4.3/lib/hashie/extensions/indifferent_access.rb:86:in `indifferent_value'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/hashie-3.4.3/lib/hashie/extensions/indifferent_access.rb:107:in `indifferent_writer'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-docker_metadata-0.1.5/lib/logstash/filters/docker_metadata.rb:92:in `filter'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.1-java/lib/logstash/filters/base.rb:151:in `multi_filter'", "org/jruby/RubyArray.java:1613:in `each'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.1-java/lib/logstash/filters/base.rb:148:in `multi_filter'", "(eval):41:in `filter_func'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.1-java/lib/logstash/pipeline.rb:244:in `filterworker'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.1-java/lib/logstash/pipeline.rb:178:in `start_filters'"], :level=>:error}