From c4961a4e100d7ff223736ce07c98eed450a3164f Mon Sep 17 00:00:00 2001 From: Maryam Saeidi Date: Tue, 17 Dec 2024 11:15:22 +0100 Subject: [PATCH] [8.16] [ES Query] Fix saving ECS group by fields for query DSL rule (#203769) (#204345) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Backport This will backport the following commits from `main` to `8.16`: - [[ES Query] Fix saving ECS group by fields for query DSL rule (#203769)](https://github.com/elastic/kibana/pull/203769) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) --- .../server/rule_types/es_query/lib/fetch_es_query.ts | 1 + .../group3/builtin_alert_types/es_query/query_dsl_only.ts | 2 +- .../deployment_agnostic/apis/observability/alerting/index.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/stack_alerts/server/rule_types/es_query/lib/fetch_es_query.ts b/x-pack/plugins/stack_alerts/server/rule_types/es_query/lib/fetch_es_query.ts index 1e6c9a498c0ad..1b29b197df136 100644 --- a/x-pack/plugins/stack_alerts/server/rule_types/es_query/lib/fetch_es_query.ts +++ b/x-pack/plugins/stack_alerts/server/rule_types/es_query/lib/fetch_es_query.ts @@ -154,6 +154,7 @@ export async function fetchEsQuery({ esResult: searchResult, resultLimit: alertLimit, sourceFieldsParams: params.sourceFields, + termField: params.termField, }), link, query: sortedQuery, diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group3/builtin_alert_types/es_query/query_dsl_only.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group3/builtin_alert_types/es_query/query_dsl_only.ts index 6fcdf9be2f40f..b25368b14ae74 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group3/builtin_alert_types/es_query/query_dsl_only.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group3/builtin_alert_types/es_query/query_dsl_only.ts @@ -33,7 +33,7 @@ export default function ruleTests({ getService }: FtrProviderContext) { const { es, esTestIndexTool, esTestIndexToolOutput, createEsDocumentsInGroups, waitForDocs } = getRuleServices(getService); - describe('rule', () => { + describe('Query DSL only', () => { let endDate: string; let connectorId: string; const objectRemover = new ObjectRemover(supertest); diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/index.ts index 336fcf65c830f..fd4b1962b2d84 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/index.ts @@ -8,7 +8,7 @@ import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { - describe('SLO - Burn rate rule', () => { + describe('Observability Alerting', () => { loadTestFile(require.resolve('./burn_rate_rule')); }); }