From 748a0a3c34f4655c59eca5cd75704ab7015e10f2 Mon Sep 17 00:00:00 2001 From: Ido Cohen <90558359+CohenIdo@users.noreply.github.com> Date: Tue, 1 Oct 2024 21:46:39 +0300 Subject: [PATCH] [Cloud Security] Ignore Unavailable Index --- .../configurations/latest_findings/use_grouped_findings.tsx | 1 + .../pages/configurations/latest_findings/use_latest_findings.ts | 2 +- .../pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx | 1 + .../pages/vulnerabilities/hooks/use_latest_vulnerabilities.tsx | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_grouped_findings.tsx b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_grouped_findings.tsx index 75234c0495f51..6d901a76a29c3 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_grouped_findings.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_grouped_findings.tsx @@ -70,6 +70,7 @@ export interface FindingsGroupingAggregation { export const getGroupedFindingsQuery = (query: GroupingQuery) => ({ ...query, index: CDR_MISCONFIGURATIONS_INDEX_PATTERN, + ignore_unavailable: true, size: 0, }); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings.ts b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings.ts index f8cd0238ef0bb..f6f27e15ee7a4 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings.ts +++ b/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings.ts @@ -51,7 +51,7 @@ export const getFindingsQuery = ( sort: getMultiFieldsSort(sort), size: MAX_FINDINGS_TO_LOAD, aggs: getFindingsCountAggQuery(), - ignore_unavailable: false, + ignore_unavailable: true, query: { ...query, bool: { diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx index 580926340438f..9fddf97e28482 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx @@ -57,6 +57,7 @@ export type VulnerabilitiesRootGroupingAggregation = export const getGroupedVulnerabilitiesQuery = (query: GroupingQuery) => ({ ...query, index: CDR_VULNERABILITIES_INDEX_PATTERN, + ignore_unavailable: true, size: 0, }); diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities.tsx b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities.tsx index 3e5bd646e7993..0d0ea9ba5a22f 100644 --- a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities.tsx +++ b/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities.tsx @@ -57,6 +57,7 @@ export const getVulnerabilitiesQuery = ( pageParam: number ) => ({ index: CDR_VULNERABILITIES_INDEX_PATTERN, + ignore_unavailable: true, sort: getMultiFieldsSort(sort), size: MAX_FINDINGS_TO_LOAD, query: {