New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature attachments #48
Feature attachments #48
Conversation
Added tests, removed the recursive search and replace it with the inbuilt all_parts method. |
@robbavey @karenzone would you be able to review this, #45 and #49? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! Couple of small nitpicks and a concern on a potential docs/functionality mismatch - an attachment may not necessarily be base64 encoded, which is inconsistent with the doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All suggestions reviewed and fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @pemontto. One suggestion: Our documentation standard is to alphabetize config options. Please move save_attachments
to above secure
in the table and the detailed descriptions.
Otherwise, the docs build cleanly and render correctly, so LGTM. Thanks for adding quality docs along with your code changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️fixed the alphabetical ordering
I tried above save_attachments , but for me is not working my conf file input { output { |
This is likely the cause, you're removing attachments. |
Thanks for quick reply , |
Are you only seeing the |
Yes i am using Es. [2020-05-19T18:43:49,509][ERROR][logstash.inputs.imap ][main] 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=>["C:/logstash/vendor/bundle/jruby/2.5.0/gems/mail-2.6.6/lib/mail/message.rb:1903:in |
@sakthiskv thanks for taking the time to run this. Would you be able to send me a copy of the email, or something similar to pemontto@gmail.com so I can take a look? Otherwise we can continue discussion at https://discuss.elastic.co/u/pemontto. |
@sakthiskv the code path causing this error isn't actually related to this PR. Would still be interested in seeing the email that causes this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs are looking good. One minor request in line.
@@ -45,6 +45,7 @@ This plugin supports the following configuration options plus the <<plugins-{typ | |||
| <<plugins-{type}s-{plugin}-password>> |<<password,password>>|Yes | |||
| <<plugins-{type}s-{plugin}-port>> |<<number,number>>|No | |||
| <<plugins-{type}s-{plugin}-secure>> |<<boolean,boolean>>|No | |||
| <<plugins-{type}s-{plugin}-save_attachments>> |<<boolean,boolean>>|No |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs are building cleanly and generally look good. Will you please move the option in the table to alpha order, too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robbavey Will you please review and comment on recent code changes? Thanks!
I sent mail to above account . |
[ERROR][logstash.inputs.imap ][main] 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=>["C:/logstash/vendor/bundle/jruby/2.5.0/gems/mail-2.6.6/lib/mail/message.rb:1903:in I am getting this error. But somehow yesterday it's worked for to get attachment like .txt files . |
This PR would be highly beneficial for a use case for us too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - @pemontto Thank you for contribution! I'm happy to merge and publish this if you are satisfied that the issue presented by @sakthiskv is not related to this PR.
Thanks @robbavey, we're debugging offline, the issue is not related to this PR. |
If this is merged, when will it be in a release? Edit; don't mean to push but we're just really helped here when we can use attachments so eager to test it :) |
@thomhubers Once the fix is merged, we will publish the plugin, at which point we will update this issue with the information. From there, the plugin can be manually updated following the instructions here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pemontto Thanks for your contribution. This is a nice addition!
Congrats on being a first-time contributor. I hope we'll be seeing you again.
Bumps version to publish changes from #48 Reorders options table in documentation
Thank you for the amazing addition. Is it possible to apply it on .eml email file format? I usually receive emails that have another email attached to it. |
Hi good day for you and everyone. So I would like to try this plugin but problem is my attachments seems to be encrypted when i try to set secure as false its not showing any output, but when i set secure as true, it show the right output even my attachment being encrypted. here is my logstash conf
|
Fixes #34
This PR adds a couple of features:
save_attachments
is true it will dump the encoded (usually base64) contents as wellExample content:
The attachment data can then be used by the Elasticsearch Ingest Attachment Processor Plugin.
Something like: