{
"_id" : "metric_DashOperations_getUser_success_latency_8d38ec7e-62f1-4b53-8e01-baacab7dad47-2019-08-13T08:57:38.355Z",
"watch_record" : {
"watch_id" : "metric_DashOperations_getUser_success_latency",
"node" : "1__-4RYsSCqVXSZna6cW4w",
"state" : "execution_not_needed",
"user" : "elastic",
"status" : {
"state" : {
"active" : true,
"timestamp" : "2019-08-13T06:33:16.756Z"
},
"last_checked" : "2019-08-13T08:57:38.355Z",
"actions" : {
"pagerduty" : {
"ack" : {
"timestamp" : "2019-08-13T06:33:16.756Z",
"state" : "awaits_successful_execution"
}
}
},
"execution_state" : "execution_not_needed",
"version" : 29
},
"trigger_event" : {
"type" : "manual",
"triggered_time" : "2019-08-13T08:57:38.352Z",
"manual" : {
"schedule" : {
"scheduled_time" : "2019-08-13T08:57:38.352Z"
}
}
},
"input" : {
"search" : {
"request" : {
"search_type" : "query_then_fetch",
"indices" : [
"prod-dash-*"
],
"types" : [ ],
"body" : {
"size" : 0,
"query" : {
"bool" : {
"filter" : {
"range" : {
"@timestamp" : {
"gte" : "{{ctx.trigger.scheduled_time}}||-3m",
"lte" : "{{ctx.trigger.scheduled_time}}",
"format" : "strict_date_optional_time||epoch_millis"
}
}
}
}
},
"aggs" : {
"bucketAgg" : {
"terms" : {
"field" : "metric_DashOperations_getUser_success_latency",
"size" : 3,
"order" : {
"metricAgg" : "desc"
}
},
"aggs" : {
"metricAgg" : {
"avg" : {
"field" : "metric_DashOperations_getUser_success_latency"
}
}
}
}
}
}
}
}
},
"condition" : {
"script" : {
"source" : "ArrayList arr = ctx.payload.aggregations.bucketAgg.buckets; for (int i = 0; i < arr.length; i++) { if (arr[i].doc_count > params.threshold) { return true; } } return false;",
"lang" : "painless",
"params" : {
"threshold" : 10000
}
}
},
"metadata" : {
"name" : "metric_DashOperations_getUser_success_latency",
"xpack" : {
"type" : "json"
}
},
"result" : {
"execution_time" : "2019-08-13T08:57:38.355Z",
"execution_duration" : 110,
"input" : {
"type" : "search",
"status" : "success",
"payload" : {
"_shards" : {
"total" : 20,
"failed" : 0,
"successful" : 20,
"skipped" : 0
},
"hits" : {
"hits" : [ ],
"total" : 0,
"max_score" : 0.0
},
"took" : 4,
"timed_out" : false,
"aggregations" : {
"bucketAgg" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
"buckets" : [ ]
}
}
},
"search" : {
"request" : {
"search_type" : "query_then_fetch",
"indices" : [
"prod-dash-*"
],
"types" : [ ],
"body" : {
"size" : 0,
"query" : {
"bool" : {
"filter" : {
"range" : {
"@timestamp" : {
"gte" : "2019-08-13T08:57:38.352Z||-3m",
"lte" : "2019-08-13T08:57:38.352Z",
"format" : "strict_date_optional_time||epoch_millis"
}
}
}
}
},
"aggs" : {
"bucketAgg" : {
"terms" : {
"field" : "metric_DashOperations_getUser_success_latency",
"size" : 3,
"order" : {
"metricAgg" : "desc"
}
},
"aggs" : {
"metricAgg" : {
"avg" : {
"field" : "metric_DashOperations_getUser_success_latency"
}
}
}
}
}
}
}
}
},
"condition" : {
"type" : "script",
"status" : "success",
"met" : false
},
"actions" : [ ]
},
"messages" : [ ]
}
}
i used this command - POST _xpack/watcher/watch/metric_DashOperations_getUser_success_latency/_execute
Is the watcher working correctly or not? why my actions and messages field in result are blank?
@Badger