Managed indices

You can change or update a policy using the managed index operations.

This table lists the fields of managed index operations.

ParameterDescriptionTypeRequiredRead Only
nameThe name of the managed index policy.stringYesNo
indexThe name of the managed index that this policy is managing.stringYesNo
index_uuidThe uuid of the index.stringYesNo
enabledWhen true, the managed index is scheduled and run by the scheduler.booleanYesNo
enabled_timeThe time the managed index was last enabled. If the managed index process is disabled, then this is null.timestampYesYes
last_updated_timeThe time the managed index was last updated.timestampYesYes
scheduleThe schedule of the managed index job.objectYesNo
policy_idThe name of the policy used by this managed index.stringYesNo
policy_seq_noThe sequence number of the policy used by this managed index.numberYesNo
policy_primary_termThe primary term of the policy used by this managed index.numberYesNo
policy_versionThe version of the policy used by this managed index.numberYesYes
policyThe cached JSON of the policy for the policy_version that’s used during runs. If the policy is null, it means that this is the first execution of the job and the latest policy document is read in/saved.objectNoNo
change_policyThe information regarding what policy and state to change to.objectNoNo
policy_nameThe name of the policy to update to. To update to the latest version, set this to be the same as the current policy_name.stringNoYes
stateThe state of the managed index after it finishes updating. If no state is specified, it’s assumed that the policy structure did not change.stringNoYes

The following example shows a managed index policy:

  1. {
  2. "managed_index": {
  3. "name": "my_index",
  4. "index": "my_index",
  5. "index_uuid": "sOKSOfkdsoSKeofjIS",
  6. "enabled": true,
  7. "enabled_time": 1553112384,
  8. "last_updated_time": 1553112384,
  9. "schedule": {
  10. "interval": {
  11. "period": 1,
  12. "unit": "MINUTES",
  13. "start_time": 1553112384
  14. }
  15. },
  16. "policy_id": "log_rotation",
  17. "policy_version": 1,
  18. "policy": {...},
  19. "change_policy": null
  20. }
  21. }

Change policy

You can change any managed index policy, but ISM has a few constraints in place to make sure that policy changes don’t break indices.

If an index is stuck in its current state, never proceeding, and you want to update its policy immediately, make sure that the new policy includes the same state—same name, same actions, same order—as the old policy. In this case, even if the policy is in the middle of executing an action, ISM applies the new policy.

If you update the policy without including an identical state, ISM updates the policy only after all actions in the current state finish executing. Alternately, you can choose a specific state in your old policy after which you want the new policy to take effect.

To change a policy using OpenSearch Dashboards, do the following:

  • Under Managed indices, choose the indices that you want to attach the new policy to.
  • To attach the new policy to indices in specific states, choose Choose state filters, and then choose those states.
  • Under Choose New Policy, choose the new policy.
  • To start the new policy for indices in the current state, choose Keep indices in their current state after the policy takes effect.
  • To start the new policy in a specific state, choose Start from a chosen state after changing policies, and then choose the default start state in your new policy.