The ILM policy allows you to manage the lifecycle of the Elasticsearch indices. The following table lists the variables that you can set in the ilm.json file. For more information on ilm.json configuration, see Automatic rollover index.

Variable

Description

max_size

Defines the maximum size of the Elasticsearch rollover index. When the index size reaches the defined value, it rolls over.max_size value should be a positive non-zero number. Allowed units are MB and GB.

max_age

Defines the maximum age of the Elasticsearch rollover index configuration. The max_age value should be a positive non-zero number. Allowed units are h for hours and d for the number of days. If both max_size andmax_age are configured, then the index rolls over based on the value that is achieved first.

min_age

Defines the minimum age, after which the Elasticsearch rollover index enters into a different phase. Allowed units are h for hours and d for the number of days. Every index starts from hot phase. For more information on the phases in an index life cycle, see Automatic rollover index.

priority

Defines the sequence in which indices are reloaded back into memory when Elasticsearch restarts. Use a positive integer number to set the priority.

Important:

Rollover index configuration takes effect only when enable_xpack is set to truein the dashboard-default.yml file. For more information, see Changing settings in dashboard-defaults.yml.

The following is a sample ilm.json file.

{
  "policy": {
    "phases": {
      "hot": {
        "actions": {
          "rollover": {
            "max_size": "7GB",
            "max_age": "7d"
          },
          "set_priority": {
            "priority": 100
          }
        }
      },
      "warm": {
        "min_age": "30d",
        "actions": {
          "set_priority": {
            "priority": 50
          }
        }
      },
      "cold": {
        "min_age": "90d",
        "actions": {
          "freeze": {},
          "set_priority": {
            "priority": 0
          }
        }
      }
    }
  }
}