diff --git a/docs/build.gradle b/docs/build.gradle index 6ae649fe316..6f9ba9a2c0c 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -47,11 +47,10 @@ testClusters.integTest { setting 'indices.lifecycle.history_index_enabled', 'false' if (BuildParams.isSnapshotBuild() == false) { systemProperty 'es.autoscaling_feature_flag_registered', 'true' + systemProperty 'es.eql_feature_flag_registered', 'true' } setting 'xpack.autoscaling.enabled', 'true' - if (BuildParams.isSnapshotBuild()) { - setting 'xpack.eql.enabled', 'true' - } + setting 'xpack.eql.enabled', 'true' } // enable regexes in painless so our tests don't complain about example snippets that use them diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/EqlPlugin.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/EqlPlugin.java index 375789761d7..c6434ab4acf 100644 --- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/EqlPlugin.java +++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/EqlPlugin.java @@ -45,6 +45,24 @@ import java.util.function.Supplier; public class EqlPlugin extends Plugin implements ActionPlugin { + private static final boolean EQL_FEATURE_FLAG_REGISTERED; + + static { + final String property = System.getProperty("es.eql_feature_flag_registered"); + if (Build.CURRENT.isSnapshot() && property != null) { + throw new IllegalArgumentException("es.eql_feature_flag_registered is only supported in non-snapshot builds"); + } + if ("true".equals(property)) { + EQL_FEATURE_FLAG_REGISTERED = true; + } else if ("false".equals(property) || property == null) { + EQL_FEATURE_FLAG_REGISTERED = false; + } else { + throw new IllegalArgumentException( + "expected es.eql_feature_flag_registered to be unset or [true|false] but was [" + property + "]" + ); + } + } + public static final Setting EQL_ENABLED_SETTING = Setting.boolSetting( "xpack.eql.enabled", false, @@ -87,7 +105,7 @@ public class EqlPlugin extends Plugin implements ActionPlugin { */ @Override public List> getSettings() { - if (isSnapshot()) { + if (isSnapshot() || EQL_FEATURE_FLAG_REGISTERED) { return Collections.singletonList(EQL_ENABLED_SETTING); } else { return Collections.emptyList();