|
2 | 2 | require "logstash/outputs/base"
|
3 | 3 | require "logstash/namespace"
|
4 | 4 |
|
5 |
| -# Send email when any event is received. |
| 5 | +# Send email when an output is received. Alternatively, you may include or |
| 6 | +# exclude the email output execution using conditionals. |
6 | 7 | class LogStash::Outputs::Email < LogStash::Outputs::Base
|
7 | 8 |
|
8 | 9 | config_name "email"
|
9 | 10 | milestone 1
|
10 | 11 |
|
11 |
| - # This setting is deprecated in favor of logstash's "conditionals" feature |
| 12 | + # This setting is deprecated in favor of Logstash's "conditionals" feature |
12 | 13 | # If you were using this setting previously, please use conditionals instead.
|
13 | 14 | #
|
14 | 15 | # If you need help converting your older 'match' setting to a conditional,
|
15 | 16 | # I welcome you to join the #logstash irc channel on freenode or to email
|
16 | 17 | # the [email protected] mailling list and ask for help! :)
|
17 | 18 | config :match, :validate => :hash, :deprecated => true
|
18 | 19 |
|
19 |
| - # Who to send this email to? |
20 |
| - # A fully qualified email address to send to |
| 20 | + # The fully-qualified email address to send the email to. |
21 | 21 | #
|
22 |
| - # This field also accept a comma separated list of emails like |
| 22 | + # This field also accepts a comma-separated string of addresses, for example: |
23 | 23 |
|
24 | 24 | #
|
25 |
| - # You can also use dynamic field from the event with the %{fieldname} syntax. |
| 25 | + # You can also use dynamic fields from the event with the %{fieldname} syntax. |
26 | 26 | config :to, :validate => :string, :required => true
|
27 | 27 |
|
28 |
| - # The From setting for email - fully qualified email address for the From: |
| 28 | + # The fully-qualified email address for the From: field in the email. |
29 | 29 | config :from, :validate => :string, :default => "[email protected]"
|
30 | 30 |
|
31 |
| - # The Reply-To setting for email - fully qualified email address is required |
32 |
| - # here. |
| 31 | + # The fully qualified email address for the Reply-To: field. |
33 | 32 | config :replyto, :validate => :string
|
34 | 33 |
|
35 |
| - # Who to CC on this email? |
| 34 | + # The fully-qualified email address(es) to include as cc: address(es). |
36 | 35 | #
|
37 |
| - # See "to" setting for what is valid here. |
| 36 | + # This field also accepts a comma-separated string of addresses, for example: |
| 37 | + |
38 | 38 | config :cc, :validate => :string
|
39 | 39 |
|
40 |
| - # how to send email: either smtp or sendmail - default to 'smtp' |
| 40 | + # How Logstash should send the email, either via SMTP or by invoking sendmail. |
41 | 41 | config :via, :validate => :string, :default => "smtp"
|
42 | 42 |
|
43 |
| - # the options to use: |
44 |
| - # smtp: address, port, enable_starttls_auto, user_name, password, authentication(bool), domain |
45 |
| - # sendmail: location, arguments |
46 |
| - # If you do not specify anything, you will get the following equivalent code set in |
| 43 | + # Specify the options to use: |
| 44 | + # |
| 45 | + # Via SMTP: smtpIporHost, port, domain, userName, password, authenticationType, starttls |
| 46 | + # |
| 47 | + # Via sendmail: location, arguments |
| 48 | + # |
| 49 | + # If you do not specify any `options`, you will get the following equivalent code set in |
47 | 50 | # every new mail object:
|
48 | 51 | #
|
49 |
| - # Mail.defaults do |
50 |
| - # delivery_method :smtp, { :address => "localhost", |
51 |
| - # :port => 25, |
52 |
| - # :domain => 'localhost.localdomain', |
53 |
| - # :user_name => nil, |
54 |
| - # :password => nil, |
55 |
| - # :authentication => nil,(plain, login and cram_md5) |
56 |
| - # :enable_starttls_auto => true } |
| 52 | + # Mail.defaults do |
| 53 | + # delivery_method :smtp, { :smtpIporHost => "localhost", |
| 54 | + # :port => 25, |
| 55 | + # :domain => 'localhost.localdomain', |
| 56 | + # :userName => nil, |
| 57 | + # :password => nil, |
| 58 | + # :authenticationType => nil,(plain, login and cram_md5) |
| 59 | + # :starttls => true } |
57 | 60 | #
|
58 |
| - # retriever_method :pop3, { :address => "localhost", |
59 |
| - # :port => 995, |
60 |
| - # :user_name => nil, |
61 |
| - # :password => nil, |
62 |
| - # :enable_ssl => true } |
63 |
| - # end |
| 61 | + # retriever_method :pop3, { :address => "localhost", |
| 62 | + # :port => 995, |
| 63 | + # :user_name => nil, |
| 64 | + # :password => nil, |
| 65 | + # :enable_ssl => true } |
64 | 66 | #
|
65 |
| - # Mail.delivery_method.new #=> Mail::SMTP instance |
66 |
| - # Mail.retriever_method.new #=> Mail::POP3 instance |
| 67 | + # Mail.delivery_method.new #=> Mail::SMTP instance |
| 68 | + # Mail.retriever_method.new #=> Mail::POP3 instance |
| 69 | + # end |
67 | 70 | #
|
68 |
| - # Each mail object inherits the default set in Mail.delivery_method, however, on |
| 71 | + # Each mail object inherits the defaults set in Mail.delivery_method. However, on |
69 | 72 | # a per email basis, you can override the method:
|
70 | 73 | #
|
71 |
| - # mail.delivery_method :sendmail |
| 74 | + # mail.delivery_method :sendmail |
72 | 75 | #
|
73 | 76 | # Or you can override the method and pass in settings:
|
74 | 77 | #
|
75 |
| - # mail.delivery_method :sendmail, { :address => 'some.host' } |
| 78 | + # mail.delivery_method :sendmail, { :address => 'some.host' } |
76 | 79 | #
|
77 | 80 | # You can also just modify the settings:
|
78 | 81 | #
|
79 |
| - # mail.delivery_settings = { :address => 'some.host' } |
| 82 | + # mail.delivery_settings = { :address => 'some.host' } |
80 | 83 | #
|
81 |
| - # The passed in hash is just merged against the defaults with +merge!+ and the result |
82 |
| - # assigned the mail object. So the above example will change only the :address value |
83 |
| - # of the global smtp_settings to be 'some.host', keeping all other values |
| 84 | + # The hash you supply is just merged against the defaults with "merge!" and the result |
| 85 | + # assigned to the mail object. For instance, the above example will change only the |
| 86 | + # `:address` value of the global `smtp_settings` to be 'some.host', retaining all other values. |
84 | 87 | config :options, :validate => :hash, :default => {}
|
85 | 88 |
|
86 |
| - # subject for email |
| 89 | + # Subject: for the email. |
87 | 90 | config :subject, :validate => :string, :default => ""
|
88 | 91 |
|
89 |
| - # body for email - just plain text |
| 92 | + # Body for the email - plain text only. |
90 | 93 | config :body, :validate => :string, :default => ""
|
91 | 94 |
|
92 |
| - # body for email - can contain html markup |
| 95 | + # HTML Body for the email, which may contain HTML markup. |
93 | 96 | config :htmlbody, :validate => :string, :default => ""
|
94 | 97 |
|
95 |
| - # attachments - has of name of file and file location |
| 98 | + # Attachments - specify the name(s) and location(s) of the files. |
96 | 99 | config :attachments, :validate => :array, :default => []
|
97 | 100 |
|
98 |
| - # contenttype : for multipart messages, set the content type and/or charset of the html part |
| 101 | + # contenttype : for multipart messages, set the content-type and/or charset of the HTML part. |
| 102 | + # NOTE: this may not be functional (KH) |
99 | 103 | config :contenttype, :validate => :string, :default => "text/html; charset=UTF-8"
|
100 | 104 |
|
101 | 105 | public
|
|
0 commit comments