-
Notifications
You must be signed in to change notification settings - Fork 24.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce an
IndexSettingsProvider
to inject logsdb index mode (#11…
…3505) Here we introduce a new implementation of `IndexSettingProvider` whose goal is to "inject" the `index.mode` setting with value `logsdb` when a cluster setting `cluster.logsdb.enabled` is `true`. We also make sure that: * the existing `index.mode` is not set * the datastream name matches the `logs-*-*` pattern * `logs@settings` component template is used
- Loading branch information
1 parent
fc9954e
commit e2281a1
Showing
13 changed files
with
648 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...k/plugin/core/src/main/java/org/elasticsearch/xpack/cluster/settings/ClusterSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
package org.elasticsearch.xpack.cluster.settings; | ||
|
||
import org.elasticsearch.common.settings.Setting; | ||
|
||
public class ClusterSettings { | ||
public static final Setting<Boolean> CLUSTER_LOGSDB_ENABLED = Setting.boolSetting( | ||
"cluster.logsdb.enabled", | ||
false, | ||
Setting.Property.Dynamic, | ||
Setting.Property.NodeScope | ||
); | ||
} |
26 changes: 26 additions & 0 deletions
26
x-pack/plugin/core/template-resources/src/main/resources/logs@settings-logsdb.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"template": { | ||
"settings": { | ||
"index": { | ||
"lifecycle": { | ||
"name": "logs" | ||
}, | ||
"mode": "logsdb", | ||
"codec": "best_compression", | ||
"mapping": { | ||
"ignore_malformed": true, | ||
"total_fields": { | ||
"ignore_dynamic_beyond_limit": true | ||
} | ||
}, | ||
"default_pipeline": "logs@default-pipeline" | ||
} | ||
} | ||
}, | ||
"_meta": { | ||
"description": "default settings for the logs index template installed by x-pack", | ||
"managed": true | ||
}, | ||
"version": ${xpack.stack.template.version}, | ||
"deprecated": ${xpack.stack.template.deprecated} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.