From 4d90cf8f1b78f5a0e074f89d8e8fa9d17f2f3e9a Mon Sep 17 00:00:00 2001 From: Mat Schaffer Date: Tue, 6 Sep 2022 23:08:40 +0900 Subject: [PATCH 1/2] Attempt: Filter out error docs from standalone cluster lists Not working yet. --- .../lib/standalone_clusters/has_standalone_clusters.ts | 7 +++++++ .../standalone_clusters/standalone_cluster_query_filter.ts | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/x-pack/plugins/monitoring/server/lib/standalone_clusters/has_standalone_clusters.ts b/x-pack/plugins/monitoring/server/lib/standalone_clusters/has_standalone_clusters.ts index 195c74ce20f7..7b234fd12c20 100644 --- a/x-pack/plugins/monitoring/server/lib/standalone_clusters/has_standalone_clusters.ts +++ b/x-pack/plugins/monitoring/server/lib/standalone_clusters/has_standalone_clusters.ts @@ -51,6 +51,13 @@ export async function hasStandaloneClusters(req: LegacyRequest, ccs: string) { }, }, ], + must_not: [ + { + exists: { + field: 'error.message', + }, + }, + ], }, }, ]; diff --git a/x-pack/plugins/monitoring/server/lib/standalone_clusters/standalone_cluster_query_filter.ts b/x-pack/plugins/monitoring/server/lib/standalone_clusters/standalone_cluster_query_filter.ts index b8712704f11f..12d140b97e27 100644 --- a/x-pack/plugins/monitoring/server/lib/standalone_clusters/standalone_cluster_query_filter.ts +++ b/x-pack/plugins/monitoring/server/lib/standalone_clusters/standalone_cluster_query_filter.ts @@ -23,6 +23,11 @@ export const standaloneClusterFilter = { field: 'cluster_uuid', }, }, + { + exists: { + field: 'error', + }, + }, ], }, }, From 0da677bff06ea4622f39b8294d1285bd2b1eb3f9 Mon Sep 17 00:00:00 2001 From: Mat Schaffer Date: Wed, 7 Sep 2022 14:39:25 +0900 Subject: [PATCH 2/2] Remove unnecessary filter standaloneClusterFilter already had this covered, but the field wasn't mapped initially. --- .../lib/standalone_clusters/has_standalone_clusters.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/x-pack/plugins/monitoring/server/lib/standalone_clusters/has_standalone_clusters.ts b/x-pack/plugins/monitoring/server/lib/standalone_clusters/has_standalone_clusters.ts index 7b234fd12c20..195c74ce20f7 100644 --- a/x-pack/plugins/monitoring/server/lib/standalone_clusters/has_standalone_clusters.ts +++ b/x-pack/plugins/monitoring/server/lib/standalone_clusters/has_standalone_clusters.ts @@ -51,13 +51,6 @@ export async function hasStandaloneClusters(req: LegacyRequest, ccs: string) { }, }, ], - must_not: [ - { - exists: { - field: 'error.message', - }, - }, - ], }, }, ];