diff --git a/plugin/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporter.java b/plugin/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporter.java index 2749f0c06c1..94371ac8b78 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporter.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/monitoring/exporter/local/LocalExporter.java @@ -506,9 +506,8 @@ public class LocalExporter extends Exporter implements ClusterStateListener, Cle if (clusterState != null) { long expirationTime = expiration.getMillis(); - // TODO: remove .marvel-* handling in 7.0 - // Get the list of monitoring index patterns (note: this will include any unaliased .marvel-* indices) - final String[] monitoringIndexPatterns = new String[] { ".monitoring-*", ".marvel-*" }; + // list of index patterns that we clean up; we may add watcher history in the future + final String[] indexPatterns = new String[] { ".monitoring-*" }; MonitoringDoc monitoringDoc = new MonitoringDoc(null, null, null, null, null, System.currentTimeMillis(), (MonitoringDoc.Node) null); @@ -525,7 +524,7 @@ public class LocalExporter extends Exporter implements ClusterStateListener, Cle for (ObjectObjectCursor index : clusterState.getMetaData().indices()) { String indexName = index.key; - if (Regex.simpleMatch(monitoringIndexPatterns, indexName)) { + if (Regex.simpleMatch(indexPatterns, indexName)) { // Never delete any "current" index (e.g., today's index or the most recent version no timestamp, like alerts) if (currents.contains(indexName)) { continue; diff --git a/plugin/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/AbstractIndicesCleanerTestCase.java b/plugin/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/AbstractIndicesCleanerTestCase.java index 8ffbc9e8d05..6548ad23c7d 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/AbstractIndicesCleanerTestCase.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/monitoring/cleaner/AbstractIndicesCleanerTestCase.java @@ -74,12 +74,8 @@ public abstract class AbstractIndicesCleanerTestCase extends MonitoringIntegTest // Will be deleted createTimestampedIndex(now().minusDays(10)); - createIndex(".marvel-es-data", now().minusYears(1)); - createIndex(".marvel-es-data-2", now().minusYears(1)); createIndex(".monitoring-data-2", now().minusDays(10)); createAlertsIndex(now().minusYears(1), MonitoringTemplateUtils.OLD_TEMPLATE_VERSION); - createIndex(".marvel-es-2016.05.03"); - createIndex(".marvel-es-2-2016.05.03"); createTimestampedIndex(now().minusDays(10), "0"); createTimestampedIndex(now().minusDays(10), "1"); createTimestampedIndex(now().minusYears(1), MonitoringTemplateUtils.OLD_TEMPLATE_VERSION); @@ -92,7 +88,7 @@ public abstract class AbstractIndicesCleanerTestCase extends MonitoringIntegTest // Won't be deleted createAlertsIndex(now().minusYears(1)); - assertIndicesCount(12); + assertIndicesCount(8); CleanerService.Listener listener = getListener(); listener.onCleanUpIndices(days(0));