Pororo
February 23, 2018, 5:30am
1
I was trying to set the email alerting according to the official doc.
The configuration for email has been set up successfully.
Here is my code segment.
POST _xpack/watcher/watches/email_test
{
"trigger" : {
"schedule" : {
"interval" : "1m"
}
},
"actions" : {
"email_admin" : {
"email" : {
"to" : "username@mail.com",
"subject" : "Error Monitoring Report",
"priority" : "high"
}
}
}
}
But it shows,
No handler found for uri [/_xpack/watcher/watches/email_test] and method [POST]
My version is 6.2.1
spinscale
(Alexander Reelsen)
February 23, 2018, 8:53am
2
Have you installed the x-pack
plugin on all nodes of your cluster?
Pororo
February 23, 2018, 5:53pm
3
I think so, cuz the slack alerting works.
spinscale
(Alexander Reelsen)
February 23, 2018, 11:20pm
4
misread your first line, you need to use PUT _xpack/watcher/watch/email_test
(not the plural)
Pororo
February 23, 2018, 11:32pm
5
Thank you so much, I got that working.
One more question, if I want to customize the "from" name of the alerting, am I supposed to do like this?
PUT _xpack/watcher/watch/email_test
{
"trigger" : {
"schedule" : {
"interval" : "1m"
}
},
"actions" : {
"email_admin" : {
"email" : {
"from" : "Symantec Alerting"
"to" : "username@mail.com",
"subject" : "Error Monitoring Report",
"priority" : "high"
}
}
}
}
Pororo
February 23, 2018, 11:44pm
6
I was trying to delete my previous watch and set a new one called countAuth
PUT _xpack/watcher/watch/countAuth
{
"trigger" : {
"schedule" : {
"interval" : "1m"
}
},
"actions" : {
"email_admin" : {
"email" : {
"from" : "Symantec Alerting"
"to" : "echowu720@gmail.com",
"subject" : "Error Monitoring Report",
"priority" : "high"
}
}
}
}
But the response shows
{
"error": {
"root_cause": [
{
"type": "i_o_exception",
"reason": "could not parse watch [countAuth]"
}
],
"type": "i_o_exception",
"reason": "could not parse watch [countAuth]",
"caused_by": {
"type": "json_parse_exception",
"reason": "Unexpected character ('\"' (code 34)): was expecting comma to separate Object entries\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@1636a0f4; line: 11, column: 10]"
}
},
"status": 500
}
spinscale
(Alexander Reelsen)
February 24, 2018, 9:33am
7
missing comma at the end of from
Pororo
February 25, 2018, 6:42pm
8
Hi,
I was trying to customize the "from" name by below,
{
"trigger": {
"schedule": {
"interval": "1m"
}
},
"input": {
"none": {}
},
"condition": {
"always": {}
},
"actions": {
"email_admin": {
"email": {
"profile": "standard",
"from": "Symantec Alerting",
"priority": "high",
"to": [
"echowu720@gmail.com"
],
"subject": "Error Monitoring Report"
}
}
}
}
But it seems the "from" field could only be a valid email address, not the customized name for displaying in email notification.
If I put "Symantec Alerting" there, it will throw the error that "Local address contains control or whitespace".
spinscale
(Alexander Reelsen)
February 27, 2018, 12:47pm
9
You can use something like Firstname Lastname <firstname.lastname@example.org>
, see https://www.elastic.co/guide/en/x-pack/6.2/actions-email.html#email-address
system
(system)
Closed
March 27, 2018, 12:48pm
10
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.