Greetings everyone
Yesterday we updated elastic from 7.4.x to 7.10.1 and some of our grafana dashboards broke with the following error:
Elasticsearch error: Validation Failed: 1: parent histogram of moving_avg aggregation [3] must have min_doc_count of 0;
The dashboard used to represent a moving average and had a min_doc_count of 20 to exclude weekends.
But now it does not work after the update.
We also updated our grafana from 6.x to 7.x, but i'm not sure if grafana is the culprit here.
I understood that the moving average aggregate cannot have min_doc_count higher than 0, and if i set it to 0, it works.
But how come in 7.4.x it worked and 7.10.1 it does not work?
Thank you for your help.
A snip of the query:
"aggs":{
"2":{
"date_histogram":{
"interval":"1d",
"field":"metadata.timestamp",
"min_doc_count":"20",
"extended_bounds":{
"min":1614248733448,
"max":1622021133448
},
"format":"epoch_millis"
},
"aggs":{
"1":{
"avg":{
"field":"some_variable_in_minutes",
"script":"(_value < 30) ? 100: 0"
}
},
"3":{
"moving_avg":{
"buckets_path":"1",
"minimize":false,
"model":"simple",
"window":5
}
}
}
}
}