logstash-plugins / logstash-filter-urldecode

Apache License 2.0
5 stars 9 forks source link

logstash-filter-urldecode v2.0.2 issues #4

Closed WangYiLong closed 8 years ago

WangYiLong commented 8 years ago

http%3A%2F%2Fimage.baidu.com%2Fsearch%2Findex%3Fct%3D201326592%26cl%3D2%26lm%3D-1%26nc%3D1%26ipn%3Dr%26tn%3Dbaiduimage%26rps%3D3%26pv%3D%26word%3Dpacific%20girls%E6%B9%BF%E6%B6%A6%26ofr%3Dlayne%25E5%25A5%2597%25E5%259B%25BE%26ie%3Dutf-8%26istype%3D2%26z%3D0%26fm%3Drs10

this encoded url can't decode by logstash-filter-urldecode v2.0.2

logstash v2.1.1

issues log:

 Exception in filterworker, the pipeline stopped processing new events, please check your filter configuration and restart Logstash. {"exception"=>#<Encoding::CompatibilityError: incompatible encodings: UTF-8 and ASCII-8BIT>, "backtrace"=>["org/jruby/RubyString.java:3064:in `gsub'", "/ctripdata/soft/logstash-2.1.1/vendor/jruby/lib/ruby/1.9/uri/common.rb:331:in `unescape'", "/ctripdata/soft/logstash-2.1.1/vendor/jruby/lib/ruby/1.9/uri/common.rb:649:in `unescape'", "/ctripdata/soft/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/logstash-filter-urldecode-2.0.2/lib/logstash/filters/urldecode.rb:50:in `urldecode'", "/ctripdata/soft/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/logstash-filter-urldecode-2.0.2/lib/logstash/filters/urldecode.rb:36:in `filter'", "org/jruby/RubyHash.java:1342:in `each'", "/ctripdata/soft/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/logstash-filter-urldecode-2.0.2/lib/logstash/filters/urldecode.rb:36:in `filter'", "/ctripdata/soft/logstash-2.1.1/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'", "/ctripdata/soft/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.1-java/lib/logstash/filters/base.rb:148:in `multi_filter'", "(eval):1109:in `filter_func'", "/ctripdata/soft/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.1-java/lib/logstash/pipeline.rb:244:in `filterworker'", "/ctripdata/soft/logstash-2.1.1/vendor/bundle/jruby/1.9/gems/logstash-core-2.1.1-java/lib/logstash/pipeline.rb:178:in `start_filters'"], :level=>:error}
jsvd commented 8 years ago

@WangYiLong can you show the configuration file? I just tested:

/tmp/logstash-2.1.1 % echo "http%3A%2F%2Fimage.baidu.com%2Fsearch%2Findex%3Fct%3D201326592%26cl%3D2%26lm%3D-1%26nc%3D1%26ipn%3Dr%26tn%3Dbaiduimage%26rps%3D3%26pv%3D%26word%3Dpacific%20girls%E6%B9%BF%E6%B6%A6%26ofr%3Dlayne%25E5%25A5%2597%25E5%259B%25BE%26ie%3Dutf-8%26istype%3D2%26z%3D0%26fm%3Drs10" | bin/logstash -f config
Settings: Default filter workers: 2
Logstash startup completed
{
       "message" => "http://image.baidu.com/search/index?ct=201326592&cl=2&lm=-1&nc=1&ipn=r&tn=baiduimage&rps=3&pv=&word=pacific girls湿润&ofr=layne%E5%A5%97%E5%9B%BE&ie=utf-8&istype=2&z=0&fm=rs10",
      "@version" => "1",
    "@timestamp" => "2015-12-28T09:29:49.509Z",
          "host" => "Joaos-MBP.lan"
}
Logstash shutdown completed
%
WangYiLong commented 8 years ago

@jsvd thanks!