You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
raiseLogStash::ConfigurationError,"The specified ILM policy #{ilm_policy} does not exist on your Elasticsearch instance"
379
+
end
380
+
381
+
# Check the Elasticsearch instance for ILM readiness - this means that the version has to be a non-OSS release, with ILM feature
382
+
# available and enabled.
383
+
begin
385
384
xpack=client.get_xpack_info
386
385
features=xpack["features"]
387
386
ilm=features["ilm"]unlessfeatures.nil?
388
387
raiseLogStash::ConfigurationError,"Index Lifecycle management is enabled in logstash, but not installed on your Elasticsearch cluster"iffeatures.nil? || ilm.nil?
389
388
raiseLogStash::ConfigurationError,"Index Lifecycle management is enabled in logstash, but not available in your Elasticsearch cluster"unlessilm['available']
390
389
raiseLogStash::ConfigurationError,"Index Lifecycle management is enabled in logstash, but not enabled in your Elasticsearch cluster"unlessilm['enabled']
# Check xpack endpoint: If no xpack endpoint, then this version of Elasticsearch is not compatible
394
392
ife.response_code == 404
395
-
false
396
393
raiseLogStash::ConfigurationError,"Index Lifecycle management is enabled in logstash, but not installed on your Elasticsearch cluster"
397
394
elsife.response_code == 400
398
-
false
399
395
raiseLogStash::ConfigurationError,"Index Lifecycle management is enabled in logstash, but not installed on your Elasticsearch cluster"
400
396
else
401
397
raisee
402
398
end
403
399
end
404
400
end
405
401
406
-
defverify_ilm_config
407
-
# Overwrite the index with the rollover alias.
408
-
@logger.warn"Overwriting index name with rollover alias #{@ilm_rollover_alias}"if@index != LogStash::Outputs::ElasticSearch::CommonConfigs::DEFAULT_INDEX_NAME
409
-
@index=@ilm_rollover_alias
410
-
verify_ilm_policyunlessilm_policy_default?
411
-
end
412
-
413
-
defilm_policy_ok?
414
-
415
-
end
416
-
417
402
defilm_policy_default?
418
403
ilm_policy == DEFAULT_POLICY
419
404
end
420
405
421
-
defverify_ilm_policy
422
-
raiseLogStash::ConfigurationError,"The specified ILM policy does not exist"unlessclient.ilm_policy_exists?(ilm_policy)
@logger.warn"Overwriting supplied index name with rollover alias #{@ilm_rollover_alias}"if@index != LogStash::Outputs::ElasticSearch::CommonConfigs::DEFAULT_INDEX_NAME
0 commit comments