【问题标题】:query output to email action查询输出到电子邮件操作
【发布时间】:2017-09-09 09:06:17
【问题描述】:
【问题讨论】:
标签:
elasticsearch
elasticsearch-x-pack
【解决方案1】:
在文档的示例中,它只指定了主题。
您可以在此页面中查看带有 body 的示例:
https://www.elastic.co/guide/en/x-pack/5.5/actions-email.html
它指定正文,并将 JSON 格式的响应添加到电子邮件的附件中。
...
"actions" : {
"email_administrator" : {
"email" : {
"to" : "sys.admino@host.domain",
"subject" : "Encountered {{ctx.payload.hits.total}} errors",
"body" : "Too many error in the system, see attached data",
"attachments" : {
"attached_data" : {
"data" : {
"format" : "json"
}
}
},
"priority" : "high"
}
}
]
...