I tried to parse e-mail attachment using IMAP input plugin in Logstash, but it keeps on returning error as:
[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'"]}
here is my configuration file:
input {
imap {
host => "host.com"
password => "password"
user => "user.co.id"
content_type => "text/html"
folder => "TEST"
port => "993"
}
}
output {
stdout { codec => rubydebug }
}
I've set the it to "TEST" folder and I've make sure that the email is there. It has attachment as sample.txt
and it contains
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
what should I do so that sample.txt could be parsed?