From 4f90cc25335d2364caf8218b6b4bea88088a4a3a Mon Sep 17 00:00:00 2001 From: Surya Sashank Nistala Date: Thu, 11 Jan 2024 01:04:50 -0800 Subject: [PATCH] use updated index names while process findings Signed-off-by: Surya Sashank Nistala --- .../org/opensearch/alerting/DocumentLevelMonitorRunner.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt b/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt index 39a359639..e5147a3e6 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt @@ -160,6 +160,7 @@ object DocumentLevelMonitorRunner : MonitorRunner() { val transformedDocs = mutableListOf>() val docsSizeInBytes = AtomicLong(0) val concreteIndicesSeenSoFar = mutableListOf() + val updatedIndexNames = mutableListOf() docLevelMonitorInput.indices.forEach { indexName -> var concreteIndices = IndexUtils.resolveAllIndices( @@ -184,6 +185,7 @@ object DocumentLevelMonitorRunner : MonitorRunner() { } concreteIndicesSeenSoFar.addAll(concreteIndices) val updatedIndexName = indexName.replace("*", "_") + updatedIndexNames.add(updatedIndexName) val conflictingFields = monitorCtx.docLevelMonitorQueries!!.getAllConflictingFields( monitorCtx.clusterService!!.state(), concreteIndices @@ -245,7 +247,7 @@ object DocumentLevelMonitorRunner : MonitorRunner() { docsToQueries, transformedDocs, docsSizeInBytes, - docLevelMonitorInput.indices, + updatedIndexNames, concreteIndicesSeenSoFar ) } @@ -259,7 +261,7 @@ object DocumentLevelMonitorRunner : MonitorRunner() { docsSizeInBytes, monitor, monitorMetadata, - docLevelMonitorInput.indices, + updatedIndexNames, concreteIndicesSeenSoFar, inputRunResults, docsToQueries