I have been using Kibana Alert API to create stack monitoring alerts for elastic search cluster, however, it doesn't work:
POST /api/alerts/alert
{
"params":{
"aggType":"avg",
"termSize":6,
"thresholdComparator":">",
"timeWindowSize":5,
"timeWindowUnit":"m",
"groupBy":"top",
"threshold":[
85
],
"timeField":"@timestamp",
"aggField":"sheet.version",
"termField":"name.keyword"
},
"consumer":"alerts",
"alertTypeId":".cpu-usage",
"schedule":{
"interval":"1m"
},
"actions":[
{
"id":"dceeb5d0-6b41-11eb-802b-85b0c1bc8ba2",
"actionTypeId":".pagerduty",
"group":"threshold met",
"params":{
"level":"info",
"message":"alert \u0027{{alertName}}\u0027 is active for group \u0027{{context.group}}\u0027:\n\n- Value: {{context.value}}\n- Conditions Met: {{context.conditions}} over {{params.timeWindowSize}}{{params.timeWindowUnit}}\n- Timestamp: {{context.date}}"
}
}
],
"tags":[
"cpu"
],
"notifyWhen":"onActionGroupChange",
"name":"my cpu alert",
"enabled":"true"
Does Kibana Alert API work for creating Elastic Stack Monitoring Alerts or only Kibana Alerts?