logstash 使用webhdfs 上传文件出现的问题

记录一次 logstash 6.5.4使用webhdfs插件向hdfs导入数据错误:

[WARN ][logstash.outputs.webhdfs ] Failed to flush outgoing items {:outgoing_count=>1, :exception=>"LogStash::Error", 
:backtrace=>[
"org/logstash/ext/JrubyEventExtLibrary.java:177:in `sprintf'", 
"/export/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/logstash-output-webhdfs-3.0.6/lib/logstash/outputs/webhdfs.rb:194:in `block in flush'", 
"org/jruby/RubyArray.java:2481:in `collect'", 
"/export/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/logstash-output-webhdfs-3.0.6/lib/logstash/outputs/webhdfs.rb:189:in `flush'", 
"/export/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/buffer.rb:219:in `block in buffer_flush'",
"org/jruby/RubyHash.java:1343:in `each'", 
"/export/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/buffer.rb:216:in `buffer_flush'", 
"/export/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/buffer.rb:159:in `buffer_receive'", 
"/export/logstash-6.5.4/vendor/bundle/jruby/2.3.0/gems/logstash-output-webhdfs-3.0.6/lib/logstash/outputs/webhdfs.rb:182:in `receive'", 
"/export/logstash-6.5.4/logstash-core/lib/logstash/outputs/base.rb:89:in `block in multi_receive'",
"org/jruby/RubyArray.java:1734:in `each'", 
"/export/logstash-6.5.4/logstash-core/lib/logstash/outputs/base.rb:89:in `multi_receive'", 
"org/logstash/config/ir/compiler/OutputStrategyExt.java:114:in `multi_receive'", 
"org/logstash/config/ir/compiler/AbstractOutputDelegatorExt.java:97:in `multi_receive'", 
"/export/logstash-6.5.4/logstash-core/lib/logstash/pipeline.rb:373:in `block in output_batch'", 
"org/jruby/RubyHash.java:1343:in `each'", "/export/logstash-6.5.4/logstash-core/lib/logstash/pipeline.rb:372:in `output_batch'", 
"/export/logstash-6.5.4/logstash-core/lib/logstash/pipeline.rb:324:in `worker_loop'", 
"/export/logstash-6.5.4/logstash-core/lib/logstash/pipeline.rb:286:in `block in start_workers'"]}

经过分析:
是webhdfs使用不当的原因在官网里的推荐配置是这样
logstash 使用webhdfs 上传文件出现的问题

而我没有完全按照该格式

解决方法:

  1. path最终我替换成了/user/ogstash/logs/output.txt
  2. 加上dt=
上一篇:嵌套路由


下一篇:$attrs和inheritAttrs灵活封装组件