diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/get_last_recovery.ts b/x-pack/plugins/monitoring/server/lib/elasticsearch/get_last_recovery.ts index 974ffad7745d9..dccdefa457b1e 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/get_last_recovery.ts +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/get_last_recovery.ts @@ -86,7 +86,12 @@ export function handleMbLastRecoveries(resp: ElasticsearchResponse, start: numbe return filtered; } -export async function getLastRecovery(req: LegacyRequest, esIndexPattern: string, size: number) { +export async function getLastRecovery( + req: LegacyRequest, + esIndexPattern: string, + mbIndexPattern: string, + size: number +) { checkParam(esIndexPattern, 'esIndexPattern in elasticsearch/getLastRecovery'); const start = req.payload.timeRange.min; @@ -105,7 +110,7 @@ export async function getLastRecovery(req: LegacyRequest, esIndexPattern: string }, }; const mbParams = { - index: esIndexPattern, + index: mbIndexPattern, size, ignore_unavailable: true, body: { diff --git a/x-pack/plugins/monitoring/server/routes/api/v1/elasticsearch/overview.js b/x-pack/plugins/monitoring/server/routes/api/v1/elasticsearch/overview.js index a0fc524768eb9..8801b2712288a 100644 --- a/x-pack/plugins/monitoring/server/routes/api/v1/elasticsearch/overview.js +++ b/x-pack/plugins/monitoring/server/routes/api/v1/elasticsearch/overview.js @@ -40,6 +40,14 @@ export function esOverviewRoute(server) { const ccs = req.payload.ccs; const clusterUuid = req.params.clusterUuid; const esIndexPattern = prefixIndexPattern(config, INDEX_PATTERN_ELASTICSEARCH, ccs); + const esLegacyIndexPattern = prefixIndexPattern( + config, + INDEX_PATTERN_ELASTICSEARCH, + ccs, + true + ); + const mbIndexPattern = prefixIndexPattern(config, 'metricbeat-*', ccs, true); + const filebeatIndexPattern = prefixIndexPattern( config, config.get('monitoring.ui.logs.index'), @@ -54,7 +62,12 @@ export function esOverviewRoute(server) { const [clusterStats, metrics, shardActivity, logs] = await Promise.all([ getClusterStats(req, esIndexPattern, clusterUuid), getMetrics(req, esIndexPattern, metricSet), - getLastRecovery(req, esIndexPattern, config.get('monitoring.ui.max_bucket_size')), + getLastRecovery( + req, + esLegacyIndexPattern, + mbIndexPattern, + config.get('monitoring.ui.max_bucket_size') + ), getLogs(config, req, filebeatIndexPattern, { clusterUuid, start, end }), ]); const indicesUnassignedShardStats = await getIndicesUnassignedShardStats(