diff --git a/src/main/java/org/opensearch/securityanalytics/util/RuleIndices.java b/src/main/java/org/opensearch/securityanalytics/util/RuleIndices.java index 5a0da3a2e..adb0fded1 100644 --- a/src/main/java/org/opensearch/securityanalytics/util/RuleIndices.java +++ b/src/main/java/org/opensearch/securityanalytics/util/RuleIndices.java @@ -5,6 +5,7 @@ package org.opensearch.securityanalytics.util; import java.util.Set; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.opensearch.OpenSearchStatusException; @@ -98,9 +99,13 @@ public static String ruleMappings() throws IOException { public void initRuleIndex(ActionListener actionListener, boolean isPrepackaged) throws IOException { if (!ruleIndexExists(isPrepackaged)) { + Settings indexSettings = Settings.builder() + .put("index.hidden", true) + .put("index.auto_expand_replicas", "0-all") + .build(); CreateIndexRequest indexRequest = new CreateIndexRequest(getRuleIndex(isPrepackaged)) .mapping(ruleMappings()) - .settings(Settings.builder().put("index.hidden", true).build()); + .settings(indexSettings); client.admin().indices().create(indexRequest, actionListener); } }