-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace action.auto_create_index
with a template setting
#20640
Comments
Pinging @elastic/es-core-infra |
* Enables setting autocreate by template as described in elastic#20640 * Closes elastic#20640
This would be a great feature, any chance? |
We discussed #56369 in today's Fix-It meeting, and came to the conclusion that the proposal in this issue is closer to what we want to do that the one described in #56369. There are some new considerations, however. In particular, the suggestion of a wildcard template ( With this proposal, we have the option of deprecating and removing |
Closes #20640. This PR introduces a new parameter to v2 templates, `allow_auto_create`, which allows templates to override the cluster setting `auto_create_index`. Notes: * `AutoCreateIndex` now looks for a matching v2 template, and if its `allow_auto_create` setting is true, it overrides the usual logic. * `TransportBulkAction` previously used `AutoCreateIndex` to check whether missing indices should be created. We now rely on `AutoCreateAction`, which was already differentiating between creating indices and creating data streams. I've updated `AutoCreateAction` to use `AutoCreateIndex`. Data streams are also influenced by `allow_auto_create`, in that their default auto-create behaviour can be disabled with this setting. * Most of the Java file changes are due to introducing an extra constructor parameter to `ComposableIndexTemplate`. * I've added the new setting to various x-pack templates * I added a YAML test to check that watches can be created even when `auto_create_index` is `false`.
…#61858) Closes elastic#20640. This PR introduces a new parameter to v2 templates, `allow_auto_create`, which allows templates to override the cluster setting `auto_create_index`. Notes: * `AutoCreateIndex` now looks for a matching v2 template, and if its `allow_auto_create` setting is true, it overrides the usual logic. * `TransportBulkAction` previously used `AutoCreateIndex` to check whether missing indices should be created. We now rely on `AutoCreateAction`, which was already differentiating between creating indices and creating data streams. I've updated `AutoCreateAction` to use `AutoCreateIndex`. Data streams are also influenced by `allow_auto_create`, in that their default auto-create behaviour can be disabled with this setting. * Most of the Java file changes are due to introducing an extra constructor parameter to `ComposableIndexTemplate`. * I've added the new setting to various x-pack templates * I added a YAML test to check that watches can be created even when `auto_create_index` is `false`.
Backport of #61858. Closes #20640. This PR introduces a new parameter to v2 templates, `allow_auto_create`, which allows templates to override the cluster setting `auto_create_index`. Notes: * `AutoCreateIndex` now looks for a matching v2 template, and if its `allow_auto_create` setting is true, it overrides the usual logic. * `TransportBulkAction` previously used `AutoCreateIndex` to check whether missing indices should be created. We now rely on `AutoCreateAction`, which was already differentiating between creating indices and creating data streams. I've updated `AutoCreateAction` to use `AutoCreateIndex`. Data streams are also influenced by `allow_auto_create`, in that their default auto-create behaviour can be disabled with this setting. * Most of the Java file changes are due to introducing an extra constructor parameter to `ComposableIndexTemplate`. * I've added the new setting to various x-pack templates * I added a YAML test to check that watches can be created even when `auto_create_index` is `false`.
In #9359 we discussed the possibility of extending the
action.auto_create_index
setting to automatically recognise index names which match templates, and to allow those to be auto-created without having to maintain both the template and the setting.In FixitFriday we came up with a better solution:
action.auto_create_index
settingauto_create_index
setting to index templates - if true, then an index can be auto-created*
index withauto_create_index: true
- this can be overridden by the userauto_create_index
setting is merged just like all other template settings - the highestorder
winsWhen upgrading, the user will see an exception if they set
action.auto_create_index
and will need to update their templates to reflect the same logic.Possibly, we could add a deprecation period where the
action.auto_create_index
setting continues to work, but also accepts a_template
value which switches to use the template-based logic instead.The text was updated successfully, but these errors were encountered: