connamara / logstash-filter-fix_protocol

FIX Protocol Logstash Filter
Other
42 stars 27 forks source link

filter crashes on malformed FIX messages #56

Closed cbusbey closed 8 years ago

cbusbey commented 8 years ago

Given the following malformed FIX message:

8=FIX.4.09=5235=034=24garbled9=TW52=20160302-18:29:1056=ISLD10=0

Filter crashes with

Exception in pipelineworker, the pipeline stopped processing new events, please check your filter configuration and restart Logstash. {"exception"=>#<ArgumentError: Constructor invocation failed: Bad tag format: For input string: "4garbled9" in 8=FIX.4.09=5235=034=24garbled9=TW52=20160302-18:29:1056=ISLD10=0>, "backtrace"=>["/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-fix_protocol-0.1.1/lib/logstash/filters/fix_message.rb:17:in `initialize'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-fix_protocol-0.1.1/lib/logstash/filters/fix_protocol.rb:38:in `filter'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-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.2.2-java/lib/logstash/filters/base.rb:148:in `multi_filter'", "(eval):67:in `filter_func'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-java/lib/logstash/pipeline.rb:256:in `filter_batch'", "org/jruby/RubyArray.java:1613:in `each'", "org/jruby/RubyEnumerable.java:852:in `inject'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-java/lib/logstash/pipeline.rb:254:in `filter_batch'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-java/lib/logstash/pipeline.rb:212:in `worker_loop'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-java/lib/logstash/pipeline.rb:190:in `start_workers'"], :level=>:error}
ArgumentError: Constructor invocation failed: Bad tag format: For input string: "4garbled9" in 8=FIX.4.09=5235=034=24garbled9=TW52=20160302-18:29:1056=ISLD10=0
     initialize at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-fix_protocol-0.1.1/lib/logstash/filters/fix_message.rb:17
         filter at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-fix_protocol-0.1.1/lib/logstash/filters/fix_protocol.rb:38
   multi_filter at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-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.2.2-java/lib/logstash/filters/base.rb:148
    filter_func at (eval):67
   filter_batch at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-java/lib/logstash/pipeline.rb:256
           each at org/jruby/RubyArray.java:1613
         inject at org/jruby/RubyEnumerable.java:852
   filter_batch at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-java/lib/logstash/pipeline.rb:254
    worker_loop at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-java/lib/logstash/pipeline.rb:212
  start_workers at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-java/lib/logstash/pipeline.rb:190

Example message comes out of FIX acceptance tests for quickfix/n/j/go

cbusbey commented 8 years ago

Still failing in same way in v0.1.2

Exception in pipelineworker, the pipeline stopped processing new events, please check your filter configuration and restart Logstash. {"exception"=>#<ArgumentError: Constructor invocation failed: Bad tag format: For input string: "4garbled9" in 8=FIX.4.09=5235=034=24garbled9=TW52=20160302-18:29:2756=ISLD10=0>, "backtrace"=>["/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-fix_protocol-0.1.2/lib/logstash/filters/fix_message.rb:17:in `initialize'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-fix_protocol-0.1.2/lib/logstash/filters/fix_protocol.rb:43:in `filter'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-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.2.2-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.2.2-java/lib/logstash/pipeline.rb:256:in `filter_batch'", "org/jruby/RubyArray.java:1613:in `each'", "org/jruby/RubyEnumerable.java:852:in `inject'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-java/lib/logstash/pipeline.rb:254:in `filter_batch'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-java/lib/logstash/pipeline.rb:212:in `worker_loop'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-java/lib/logstash/pipeline.rb:190:in `start_workers'"], :level=>:error}
ArgumentError: Constructor invocation failed: Bad tag format: For input string: "4garbled9" in 8=FIX.4.09=5235=034=24garbled9=TW52=20160302-18:29:2756=ISLD10=0
     initialize at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-fix_protocol-0.1.2/lib/logstash/filters/fix_message.rb:17
         filter at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-filter-fix_protocol-0.1.2/lib/logstash/filters/fix_protocol.rb:43
   multi_filter at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-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.2.2-java/lib/logstash/filters/base.rb:148
    filter_func at (eval):41
   filter_batch at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-java/lib/logstash/pipeline.rb:256
           each at org/jruby/RubyArray.java:1613
         inject at org/jruby/RubyEnumerable.java:852
   filter_batch at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-java/lib/logstash/pipeline.rb:254
    worker_loop at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-java/lib/logstash/pipeline.rb:212
  start_workers at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-2.2.2-java/lib/logstash/pipeline.rb:190