The Index Lifecycle Management (ILM) policy allows for an automatic rollover of index based on time or size of data. The ilm.json file contains the configurations of the policy. 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 roll overs.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. 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 and max_age are configured, then the index rolls over based on the value which 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.

Following is snippet of 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
          }
        }
      }
    }
  }
}