logstash-output-email 4.0.3 → 4.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a9af05ddd631994d6459e2e81b377d70c28c377
4
- data.tar.gz: aa7238cb8ca5431f546bd847cad28d18b8e3ed30
3
+ metadata.gz: 3a21e40d5ec3c92d44dcbf6c5973fa5086d534e5
4
+ data.tar.gz: b3890fd8f5117f846d25a247f52c8dbad1f7b28e
5
5
  SHA512:
6
- metadata.gz: 01a65e93dd3a3cb5cc4a80e6dfff8c55973c1750166d98b8bb5c7e51332c2800e088ebfe65315fdb5d06d4d05c3f483c1bc1f43f78aca6ea5ef466cba0fe2d24
7
- data.tar.gz: 3a7a870a18f54a19b2401d295cdbf2a953663cf40d61453d2e008c24285462745acf465e771de3f081b178f9f02f69bad2faeee5397bc40276d5e70076e62f64
6
+ metadata.gz: 64c18054a7e49fb7c40d89a758bcc1e158e8d715610396a61844809b891d1e48e719a811bbf52df704c87f31f1b4f1ff7e591c35ae516147e3f281c0d4355e66
7
+ data.tar.gz: 7761cc2a9fd55506c70c5a05a483003c0c717a24612125905019d6fba9750e6d52ff204637cd507d3e5f701bc731c00c7cafc5d2800deef753fcc52261f1550f
data/Gemfile CHANGED
@@ -1,4 +1,11 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in logstash-mass_effect.gemspec
4
3
  gemspec
4
+
5
+ logstash_path = ENV["LOGSTASH_PATH"] || "../../logstash"
6
+ use_logstash_source = ENV["LOGSTASH_SOURCE"] && ENV["LOGSTASH_SOURCE"].to_s == "1"
7
+
8
+ if Dir.exist?(logstash_path) && use_logstash_source
9
+ gem 'logstash-core', :path => "#{logstash_path}/logstash-core"
10
+ gem 'logstash-core-plugin-api', :path => "#{logstash_path}/logstash-core-plugin-api"
11
+ end
@@ -0,0 +1,233 @@
1
+ :plugin: email
2
+ :type: output
3
+
4
+ ///////////////////////////////////////////
5
+ START - GENERATED VARIABLES, DO NOT EDIT!
6
+ ///////////////////////////////////////////
7
+ :version: %VERSION%
8
+ :release_date: %RELEASE_DATE%
9
+ :changelog_url: %CHANGELOG_URL%
10
+ :include_path: ../../../../logstash/docs/include
11
+ ///////////////////////////////////////////
12
+ END - GENERATED VARIABLES, DO NOT EDIT!
13
+ ///////////////////////////////////////////
14
+
15
+ [id="plugins-{type}-{plugin}"]
16
+
17
+ === Email output plugin
18
+
19
+ include::{include_path}/plugin_header.asciidoc[]
20
+
21
+ ==== Description
22
+
23
+
24
+ ==== Usage Example
25
+ [source,ruby]
26
+ ----------------------------------
27
+ output {
28
+ if "shouldmail" in [tags] {
29
+ email {
30
+ to => 'technical@logstash.net'
31
+ from => 'monitor@logstash.net'
32
+ subject => 'Alert - %{title}'
33
+ body => "Tags: %{tags}\\n\\Content:\\n%{message}"
34
+ domain => 'mail.logstash.net'
35
+ port => 25
36
+ }
37
+ }
38
+ }
39
+ ----------------------------------
40
+ Send email when an output is received. Alternatively, you may include or
41
+ exclude the email output execution using conditionals.
42
+
43
+ [id="plugins-{type}s-{plugin}-options"]
44
+ ==== Email Output Configuration Options
45
+
46
+ This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
47
+
48
+ [cols="<,<,<",options="header",]
49
+ |=======================================================================
50
+ |Setting |Input type|Required
51
+ | <<plugins-{type}s-{plugin}-address>> |<<string,string>>|No
52
+ | <<plugins-{type}s-{plugin}-attachments>> |<<array,array>>|No
53
+ | <<plugins-{type}s-{plugin}-authentication>> |<<string,string>>|No
54
+ | <<plugins-{type}s-{plugin}-body>> |<<string,string>>|No
55
+ | <<plugins-{type}s-{plugin}-cc>> |<<string,string>>|No
56
+ | <<plugins-{type}s-{plugin}-contenttype>> |<<string,string>>|No
57
+ | <<plugins-{type}s-{plugin}-debug>> |<<boolean,boolean>>|No
58
+ | <<plugins-{type}s-{plugin}-domain>> |<<string,string>>|No
59
+ | <<plugins-{type}s-{plugin}-from>> |<<string,string>>|No
60
+ | <<plugins-{type}s-{plugin}-htmlbody>> |<<string,string>>|No
61
+ | <<plugins-{type}s-{plugin}-password>> |<<string,string>>|No
62
+ | <<plugins-{type}s-{plugin}-port>> |<<number,number>>|No
63
+ | <<plugins-{type}s-{plugin}-replyto>> |<<string,string>>|No
64
+ | <<plugins-{type}s-{plugin}-subject>> |<<string,string>>|No
65
+ | <<plugins-{type}s-{plugin}-to>> |<<string,string>>|Yes
66
+ | <<plugins-{type}s-{plugin}-use_tls>> |<<boolean,boolean>>|No
67
+ | <<plugins-{type}s-{plugin}-username>> |<<string,string>>|No
68
+ | <<plugins-{type}s-{plugin}-via>> |<<string,string>>|No
69
+ |=======================================================================
70
+
71
+ Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
72
+ output plugins.
73
+
74
+ &nbsp;
75
+
76
+ [id="plugins-{type}s-{plugin}-address"]
77
+ ===== `address`
78
+
79
+ * Value type is <<string,string>>
80
+ * Default value is `"localhost"`
81
+
82
+ The address used to connect to the mail server
83
+
84
+ [id="plugins-{type}s-{plugin}-attachments"]
85
+ ===== `attachments`
86
+
87
+ * Value type is <<array,array>>
88
+ * Default value is `[]`
89
+
90
+ Attachments - specify the name(s) and location(s) of the files.
91
+
92
+ [id="plugins-{type}s-{plugin}-authentication"]
93
+ ===== `authentication`
94
+
95
+ * Value type is <<string,string>>
96
+ * There is no default value for this setting.
97
+
98
+ Authentication method used when identifying with the server
99
+
100
+ [id="plugins-{type}s-{plugin}-body"]
101
+ ===== `body`
102
+
103
+ * Value type is <<string,string>>
104
+ * Default value is `""`
105
+
106
+ Body for the email - plain text only.
107
+
108
+ [id="plugins-{type}s-{plugin}-cc"]
109
+ ===== `cc`
110
+
111
+ * Value type is <<string,string>>
112
+ * There is no default value for this setting.
113
+
114
+ The fully-qualified email address(es) to include as cc: address(es).
115
+
116
+ This field also accepts a comma-separated string of addresses, for example:
117
+ `"me@host.com, you@host.com"`
118
+
119
+ [id="plugins-{type}s-{plugin}-contenttype"]
120
+ ===== `contenttype`
121
+
122
+ * Value type is <<string,string>>
123
+ * Default value is `"text/html; charset=UTF-8"`
124
+
125
+ contenttype : for multipart messages, set the content-type and/or charset of the HTML part.
126
+ NOTE: this may not be functional (KH)
127
+
128
+ [id="plugins-{type}s-{plugin}-debug"]
129
+ ===== `debug`
130
+
131
+ * Value type is <<boolean,boolean>>
132
+ * Default value is `false`
133
+
134
+ Run the mail relay in debug mode
135
+
136
+ [id="plugins-{type}s-{plugin}-domain"]
137
+ ===== `domain`
138
+
139
+ * Value type is <<string,string>>
140
+ * Default value is `"localhost"`
141
+
142
+ Domain used to send the email messages
143
+
144
+ [id="plugins-{type}s-{plugin}-from"]
145
+ ===== `from`
146
+
147
+ * Value type is <<string,string>>
148
+ * Default value is `"logstash.alert@nowhere.com"`
149
+
150
+ The fully-qualified email address for the From: field in the email.
151
+
152
+ [id="plugins-{type}s-{plugin}-htmlbody"]
153
+ ===== `htmlbody`
154
+
155
+ * Value type is <<string,string>>
156
+ * Default value is `""`
157
+
158
+ HTML Body for the email, which may contain HTML markup.
159
+
160
+ [id="plugins-{type}s-{plugin}-password"]
161
+ ===== `password`
162
+
163
+ * Value type is <<string,string>>
164
+ * There is no default value for this setting.
165
+
166
+ Password to authenticate with the server
167
+
168
+ [id="plugins-{type}s-{plugin}-port"]
169
+ ===== `port`
170
+
171
+ * Value type is <<number,number>>
172
+ * Default value is `25`
173
+
174
+ Port used to communicate with the mail server
175
+
176
+ [id="plugins-{type}s-{plugin}-replyto"]
177
+ ===== `replyto`
178
+
179
+ * Value type is <<string,string>>
180
+ * There is no default value for this setting.
181
+
182
+ The fully qualified email address for the Reply-To: field.
183
+
184
+ [id="plugins-{type}s-{plugin}-subject"]
185
+ ===== `subject`
186
+
187
+ * Value type is <<string,string>>
188
+ * Default value is `""`
189
+
190
+ Subject: for the email.
191
+
192
+ [id="plugins-{type}s-{plugin}-to"]
193
+ ===== `to`
194
+
195
+ * This is a required setting.
196
+ * Value type is <<string,string>>
197
+ * There is no default value for this setting.
198
+
199
+ The fully-qualified email address to send the email to.
200
+
201
+ This field also accepts a comma-separated string of addresses, for example:
202
+ `"me@host.com, you@host.com"`
203
+
204
+ You can also use dynamic fields from the event with the `%{fieldname}` syntax.
205
+
206
+ [id="plugins-{type}s-{plugin}-use_tls"]
207
+ ===== `use_tls`
208
+
209
+ * Value type is <<boolean,boolean>>
210
+ * Default value is `false`
211
+
212
+ Enables TLS when communicating with the server
213
+
214
+ [id="plugins-{type}s-{plugin}-username"]
215
+ ===== `username`
216
+
217
+ * Value type is <<string,string>>
218
+ * There is no default value for this setting.
219
+
220
+ Username to authenticate with the server
221
+
222
+ [id="plugins-{type}s-{plugin}-via"]
223
+ ===== `via`
224
+
225
+ * Value type is <<string,string>>
226
+ * Default value is `"smtp"`
227
+
228
+ How Logstash should send the email, either via SMTP or by invoking sendmail.
229
+
230
+
231
+
232
+ [id="plugins-{type}s-{plugin}-common-options"]
233
+ include::{include_path}/{type}.asciidoc[]
@@ -1,16 +1,35 @@
1
+ #
2
+ # ==== Usage Example
3
+
4
+ # [source,ruby]
5
+ # ----------------------------------
6
+ # output {
7
+ # if "shouldmail" in [tags] {
8
+ # email {
9
+ # to => 'technical@logstash.net'
10
+ # from => 'monitor@logstash.net'
11
+ # subject => 'Alert - %{title}'
12
+ # body => "Tags: %{tags}\\n\\Content:\\n%{message}"
13
+ # domain => 'mail.logstash.net'
14
+ # port => 25
15
+ # }
16
+ # }
17
+ # }
18
+ # ----------------------------------
19
+
1
20
  # encoding: utf-8
2
21
  require "logstash/outputs/base"
3
22
  require "logstash/namespace"
4
23
 
5
24
  # Send email when an output is received. Alternatively, you may include or
6
- # exclude the email output execution using conditionals.
25
+ # exclude the email output execution using conditionals.
7
26
  class LogStash::Outputs::Email < LogStash::Outputs::Base
8
27
 
9
28
  config_name "email"
10
29
 
11
30
  # The fully-qualified email address to send the email to.
12
31
  #
13
- # This field also accepts a comma-separated string of addresses, for example:
32
+ # This field also accepts a comma-separated string of addresses, for example:
14
33
  # `"me@host.com, you@host.com"`
15
34
  #
16
35
  # You can also use dynamic fields from the event with the `%{fieldname}` syntax.
@@ -24,7 +43,7 @@ class LogStash::Outputs::Email < LogStash::Outputs::Base
24
43
 
25
44
  # The fully-qualified email address(es) to include as cc: address(es).
26
45
  #
27
- # This field also accepts a comma-separated string of addresses, for example:
46
+ # This field also accepts a comma-separated string of addresses, for example:
28
47
  # `"me@host.com, you@host.com"`
29
48
  config :cc, :validate => :string
30
49
 
@@ -104,7 +123,7 @@ class LogStash::Outputs::Email < LogStash::Outputs::Base
104
123
 
105
124
  public
106
125
  def receive(event)
107
-
126
+
108
127
 
109
128
  @logger.debug? and @logger.debug("Creating mail with these settings : ", :via => @via, :options => @options, :from => @from, :to => @to, :cc => @cc, :subject => @subject, :body => @body, :content_type => @contenttype, :htmlbody => @htmlbody, :attachments => @attachments, :to => to, :to => to)
110
129
  formatedSubject = event.sprintf(@subject)
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-output-email'
4
- s.version = '4.0.3'
4
+ s.version = '4.0.4'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Send email when an output is received."
7
7
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.require_paths = ["lib"]
12
12
 
13
13
  # Files
14
- s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
14
+ s.files = Dir["lib/**/*","spec/**/*","*.gemspec","*.md","CONTRIBUTORS","Gemfile","LICENSE","NOTICE.TXT", "vendor/jar-dependencies/**/*.jar", "vendor/jar-dependencies/**/*.rb", "VERSION", "docs/**/*"]
15
15
 
16
16
  # Tests
17
17
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-email
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.3
4
+ version: 4.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-04 00:00:00.000000000 Z
11
+ date: 2017-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -112,6 +112,7 @@ files:
112
112
  - LICENSE
113
113
  - NOTICE.TXT
114
114
  - README.md
115
+ - docs/index.asciidoc
115
116
  - lib/logstash/outputs/email.rb
116
117
  - logstash-output-email.gemspec
117
118
  - spec/outputs/email_spec.rb