Evaluate all elements in array [array_compare]

Hi,

I'm trying do a watcher that examines a array with a certain value, which in turn is in another vector.

It will be, compare "dp_avg.value" with "dp_actual.buckets.key".
"buckets" : [
{
"doc_count" : 4,
"dp_avg" : {
"value" : 52.25
},
"key" : "Motor1",
"dp_actual" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
"buckets" : [
{
"doc_count" : 2,
"key" : 40
},
{
"doc_count" : 1,
"key" : 50
},
{
"doc_count" : 1,
"key" : 60
}
]
}
}

The problem is that I don't know check all array, only I can access to first element.

"condition":{
"array_compare":{
"ctx.payload.aggregations.datapoint.buckets.0.dp_actual.buckets":{
"path": "key",
"gte":{
"value": "{{ctx.payload.aggregations.datapoint.buckets.0.dp_avg.value}}"
}
}
}
}

How could I evaluate all array?

you should go with a script condition instead, as this is not supported in the array_compare condition.

--Alex

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.