Vya*_*pal 8 elasticsearch elasticsearch-x-pack
我正在创建一个应用程序,我需要为我的日志发送电子邮件警报.以下是创建观察者的输入:
PUT _xpack/watcher/watch/log_error_watch
{
"trigger" : {
"schedule" : { "interval" : "10s" }
},
"input" : {
"search" : {
"request" : {
"indices" : [ "testindexv4" ],
"body" : {
"query" : {
"match" : { "log_level": "ERROR" }
}
}
}
}
}
,
"actions" : {
"send_email" : {
"email" : {
"to" : "<mailId>@gmail.com",
"subject" : "Watcher Notification",
"body" : "error logs found"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是elasticsearch.yml的配置
xpack.security.enabled: false
xpack.notification.email.account:
standard_account:
profile: standard
smtp:
auth: false
starttls.enable: false
starttls.required: false
host: smtp.gmail.com
port: 587
Run Code Online (Sandbox Code Playgroud)
当我尝试运行我的观察者时,我得到的错误是:
reason": "530 5.7.0 Must issue a STARTTLS command first. o63-v6sm4041934ywc.36 - gsmtp\n
有什么解决方案吗?
现在已经解决了,我需要做的就是启用 TLS 身份验证。
这是我更新的elasticsearch.yml内容:
xpack.security.enabled: false
xpack.notification.email.account:
standard_account:
profile: standard
smtp:
auth: true
starttls.enable: true
starttls.required: true
host: smtp.gmail.com
port: 587
user: <mailId>
password: <passowrd>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
746 次 |
| 最近记录: |