From 178c2746ba07f81e55ed1036e15921480755757d Mon Sep 17 00:00:00 2001 From: Matias Chomicki Date: Tue, 6 Jun 2023 14:20:38 +0200 Subject: [PATCH] Elasticsearch: check for filter type when accessing field aggs --- public/app/plugins/datasource/elasticsearch/datasource.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/app/plugins/datasource/elasticsearch/datasource.ts b/public/app/plugins/datasource/elasticsearch/datasource.ts index aae00c6cde4..12ed6889243 100644 --- a/public/app/plugins/datasource/elasticsearch/datasource.ts +++ b/public/app/plugins/datasource/elasticsearch/datasource.ts @@ -801,6 +801,9 @@ export class ElasticDatasource if (target.bucketAggs) { for (const bucketAgg of target.bucketAggs) { + if (bucketAgg.type !== 'filters' && this.templateSrv.containsTemplate(bucketAgg.field)) { + return true; + } if (this.objectContainsTemplate(bucketAgg.settings)) { return true; }