I am trying to create an alert for 404 request using POST api for opendistro,
My request looks like this:
GET _opendistro/_alerting/monitors/89O5w2kBky_xhYOzSrqI
POST _opendistro/_alerting/monitors
{
"monitor" : {
"type" : "monitor",
"name" : "test-monitor-404",
"enabled" : false,
"enabled_time" : null,
"schedule" : {
"period" : {
"interval" : 1,
"unit" : "MINUTES"
}
},
"inputs" : [
{
"search" : {
"indices" : [
"filebeat-*"
],
"query" : {
"size" : 0,
"query" : {
"bool" : {
"must": [
{
"range" : {
"@timestamp" : {
"from" : "{{period_end}}||-5m",
"to" : "{{period_end}}",
"include_lower" : true,
"include_upper" : true,
"format" : "epoch_millis",
"boost" : 1.0
}
}
},
{
"match": {
"status": "404"
}
}
],
"adjust_pure_negative" : true,
"boost" : 1.0
}
},
"aggregations" : { }
}
}
}
],
"triggers" : [
{
"id" : "ldO6w2kBky_xhYOzeLz9",
"name" : "test",
"severity" : "1",
"condition" : {
"script" : {
"source" : "ctx.results[0].hits.total > 1",
"lang" : "painless"
}
},
"actions" : [
{
"throttle_period_in_millis" : 300000,
"name" : "test",
"destination_id" : "7NOtw2kBky_xhYOzYqqB",
"subject_template" : {
"source" : "test",
"lang" : "mustache"
},
"message_template" : {
"source" : "test message ",
"lang" : "mustache"
}
}
]
}
]
}
}
But whenever I try to run it from dev tools, it is throwing an error:
{
"error": {
"root_cause": [
{
"type": "uninitialized_property_access_exception",
"reason": "lateinit property name has not been initialized"
}
],
"type": "uninitialized_property_access_exception",
"reason": "lateinit property name has not been initialized"
},
"status": 500
}
What am I missing?