|
@@ -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<Boolean> EQL_ENABLED_SETTING = Setting.boolSetting(
|
|
|
"xpack.eql.enabled",
|
|
|
false,
|
|
@@ -83,7 +101,7 @@ public class EqlPlugin extends Plugin implements ActionPlugin {
|
|
|
*/
|
|
|
@Override
|
|
|
public List<Setting<?>> getSettings() {
|
|
|
- if (isSnapshot()) {
|
|
|
+ if (isSnapshot() || EQL_FEATURE_FLAG_REGISTERED) {
|
|
|
return List.of(EQL_ENABLED_SETTING);
|
|
|
} else {
|
|
|
return List.of();
|