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
This commit adds Index Lifecycle Management (ILM) support to the Elasticsearch output.
It will write Index Lifecycle Management settings to managed templates, create a default ILM policy (where indices will automatically rollover if they either reach `50GB` in size or a age of `30 days`) if required, or use policies predefined in Elasticsearch if preferred. Rollover aliases are automatically created, and data will be ingested to those aliases.
@logger.info("Using Index lifecycle management - this feature is currently in beta.")
9
+
@logger.warn"Overwriting supplied index name with rollover alias #{@ilm_rollover_alias}"if@index != LogStash::Outputs::ElasticSearch::CommonConfigs::DEFAULT_INDEX_NAME
10
+
@index=ilm_rollover_alias
11
+
12
+
maybe_create_rollover_alias
13
+
maybe_create_ilm_policy
14
+
end
15
+
16
+
defilm_enabled?
17
+
@ilm_enabled
18
+
end
19
+
20
+
defverify_ilm_readiness
21
+
returnunlessilm_enabled?
22
+
23
+
# Check the Elasticsearch instance for ILM readiness - this means that the version has to be a non-OSS release, with ILM feature
24
+
# available and enabled.
25
+
begin
26
+
xpack=client.get_xpack_info
27
+
features=xpack["features"]
28
+
ilm=features.nil? ? nil : features["ilm"]
29
+
raiseLogStash::ConfigurationError,"Index Lifecycle management is enabled in logstash, but not installed on your Elasticsearch cluster"iffeatures.nil? || ilm.nil?
30
+
raiseLogStash::ConfigurationError,"Index Lifecycle management is enabled in logstash, but not available in your Elasticsearch cluster"unlessilm['available']
31
+
raiseLogStash::ConfigurationError,"Index Lifecycle management is enabled in logstash, but not enabled in your Elasticsearch cluster"unlessilm['enabled']
0 commit comments