其余版本请参阅版本化的插件文档。html
有关插件的问题,请在讨论论坛中打开一个主题,对于bug或特性请求,在Github中打开一个issue,关于Elastic支持的插件列表,请考虑Elastic支持矩阵。git
当收到输出时发送email,或者,你能够使用条件包含或排除email输出执行。github
output { if "shouldmail" in [tags] { email { to => 'technical@example.com' from => 'monitor@example.com' subject => 'Alert - %{title}' body => "Tags: %{tags}\\n\\Content:\\n%{message}" template_file => "/tmp/email_template.mustache" domain => 'mail.example.com' port => 25 } } }
此插件支持如下配置选项以及稍后描述的通用选项。服务器
设置 | 输入类型 | 要求 |
---|---|---|
address |
string | No |
attachments |
array | No |
authentication |
string | No |
body |
string | No |
cc |
string | No |
bcc |
string | No |
contenttype |
string | No |
debug |
boolean | No |
domain |
string | No |
from |
string | No |
htmlbody |
string | No |
password |
string | No |
port |
number | No |
replyto |
string | No |
subject |
string | No |
to |
string | Yes |
use_tls |
boolean | No |
username |
string | No |
via |
string | No |
template_file |
path | No |
还能够查看全部输出插件支持的通用选项列表。dom
address
ide
“localhost”
attachments
测试
[]
authentication
ui
body
编码
""
cc
插件
该字段还接受以逗号分隔的地址字符串,例如:“me@example.com, you@example.com”
bcc
contenttype
"text/html; charset=UTF-8"
debug
false
domain
“localhost”
from
“logstash.alert@example.com”
htmlbody
""
password
port
25
replyto
subject
""
to
“me@example.com, you@example.com”
,你还能够使用%{fieldname}
语法从事件中获取的动态字段use_tls
false
username
via
"smtp"
template_file
body
一块儿发送多部分的电子邮件,优先于htmlBody
全部输出插件都支持如下配置选项:
设置 | 输入类型 | 要求 |
---|---|---|
codec |
codec | No |
enable_metric |
boolean | No |
id |
string | No |
codec
"plain"
enable_metric
true
id
在插件配置中添加惟一的ID
,若是没有指定ID,则Logstash将生成一个,强烈建议在配置中设置此ID,当你有两个或多个相同类型的插件时,这一点特别有用。例如,若是你有两个电子邮件输出,在本例中添加一个命名ID将有助于在使用监控API时监控Logstash。
output { email { id => "my_plugin_id" } }