Hi everyone,
I was looking at my results from my watcher and while it states execution_not_needed
, when I look at the execution output, there are no results from my query.
Is this normal behaviour?
// Execution Output
{
"watch_id": "disk_usage",
"node": "7PFUTZb6RgKmI38clwXr2g",
"state": "execution_not_needed",
"user": "ttran",
"status": {
"state": {
"active": true,
"timestamp": "2019-09-05T05:58:31.135Z"
},
"last_checked": "2019-09-08T05:59:05.686Z",
"actions": {
"notify-slack": {
"ack": {
"timestamp": "2019-09-05T05:58:31.135Z",
"state": "awaits_successful_execution"
}
}
},
"execution_state": "execution_not_needed",
"version": -1
},
"trigger_event": {
"type": "schedule",
"triggered_time": "2019-09-08T05:59:05.686Z",
"schedule": {
"scheduled_time": "2019-09-08T05:59:05.428Z"
}
},
"input": {
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"index*"
],
"types": [
"doc"
],
"rest_total_hits_as_int": true,
"body": {
"query": {
"bool": {
"filter": [
{
"range": {
"timestamp": {
"gte": "{{ctx.trigger.scheduled_time}}||-5m"
}
}
},
{
"term": {
"type": {
"value": "node_stats"
}
}
}
]
}
},
"aggs": {
"nodes": {
"terms": {
"field": "source_node.name",
"size": 100
},
"aggs": {
"total_in_bytes": {
"max": {
"field": "node_stats.fs.total.total_in_bytes"
}
},
"available_in_bytes": {
"max": {
"field": "node_stats.fs.total.available_in_bytes"
}
},
"free_ratio": {
"bucket_script": {
"buckets_path": {
"available_in_bytes": "available_in_bytes",
"total_in_bytes": "total_in_bytes"
},
"script": "params.available_in_bytes / params.total_in_bytes"
}
}
}
}
},
"size": 0
}
}
}
},
"condition": {
"script": {
"source": "return ctx.payload.aggregations.nodes.buckets.stream().anyMatch(it -> it.free_ratio.value < ctx.metadata.lower_bound);",
"lang": "painless"
}
},
"metadata": {
"cluster": "hrc",
"lower_bound": 0.25
},
"result": {
"execution_time": "2019-09-08T05:59:05.686Z",
"execution_duration": 4,
"input": {
"type": "search",
"status": "success",
"payload": {
"_shards": {
"total": 7,
"failed": 0,
"successful": 7,
"skipped": 0
},
"hits": {
"hits": [],
"total": 0,
"max_score": null
},
"took": 4,
"timed_out": false,
"aggregations": {
"nodes": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": []
}
}
},
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"index*"
],
"types": [
"doc"
],
"rest_total_hits_as_int": true,
"body": {
"query": {
"bool": {
"filter": [
{
"range": {
"timestamp": {
"gte": "2019-09-08T05:59:05.428Z||-5m"
}
}
},
{
"term": {
"type": {
"value": "node_stats"
}
}
}
]
}
},
"aggs": {
"nodes": {
"terms": {
"field": "source_node.name",
"size": 100
},
"aggs": {
"total_in_bytes": {
"max": {
"field": "node_stats.fs.total.total_in_bytes"
}
},
"available_in_bytes": {
"max": {
"field": "node_stats.fs.total.available_in_bytes"
}
},
"free_ratio": {
"bucket_script": {
"buckets_path": {
"available_in_bytes": "available_in_bytes",
"total_in_bytes": "total_in_bytes"
},
"script": "params.available_in_bytes / params.total_in_bytes"
}
}
}
}
},
"size": 0
}
}
}
},
"condition": {
"type": "script",
"status": "success",
"met": false
},
"actions": []
},
"messages": []
}
// Results from just running the query: