logstash imap输入插件无法读取带有附件的电子邮件

r6hnlfcb  于 2021-06-10  发布在  ElasticSearch
关注(0)|答案(0)|浏览(577)

我试图在logstash中使用imap输入插件解析电子邮件附件,但它不断返回错误:

[ERROR] 2020-10-06 21:33:40.789 [[main]<imap] imap - Encountered error NoMethodError {:message=>"Can not decode an entire message, try calling #decoded on the various fields and body or parts if it is a multipart message.", :backtrace=>["/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/mail-2.6.6/lib/mail/message.rb:1903:in `decoded'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.0.7/lib/logstash/inputs/imap.rb:163:in `parse_mail'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.0.7/lib/logstash/inputs/imap.rb:118:in `block in check_mail'", "org/jruby/RubyArray.java:1809:in `each'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.0.7/lib/logstash/inputs/imap.rb:112:in `block in check_mail'", "org/jruby/RubyArray.java:1851:in `each_slice'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.0.7/lib/logstash/inputs/imap.rb:110:in `check_mail'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.0.7/lib/logstash/inputs/imap.rb:91:in `block in run'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/stud-0.0.23/lib/stud/interval.rb:20:in `interval'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-imap-3.0.7/lib/logstash/inputs/imap.rb:90:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:346:in `inputworker'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:337:in `block in start_input'"]}

这是我的日志存储配置文件:

input {
    imap {
        host => "host.com"
        password => "password"
        user => "user.co.id"
        content_type => "text/html"
        folder => "TEST"
        port => "993"
    }
}

output {
    stdout { codec => rubydebug }
}

我已经将它设置为“测试”文件夹,并确保电子邮件在那里。它的附件是 sample.txt 它包含

kol1,kol2,kol3,kol4,kol5
1,2,3,4,5
11,22,33,44,55
111,222,333,444,555
1111,2222,3333,4444,5555

我该怎么做才能让它解析附件?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题