Complete the code to define a policy that deletes an index after 30 days.
{
"policy": {
"phases": {
"delete": {
"min_age": "[1]",
"actions": {
"delete": {}
}
}
}
}
}The min_age value specifies how long the index should live before the delete action runs. 30d means 30 days.
Complete the code to add a rollover action when the index reaches 50GB.
{
"policy": {
"phases": {
"hot": {
"actions": {
"rollover": {
"max_size": "[1]"
}
}
}
}
}
}The max_size in rollover defines the maximum index size before rollover. 50gb means 50 gigabytes.
Fix the error in the policy that tries to move an index to warm phase after 10 days.
{
"policy": {
"phases": {
"warm": {
"min_age": "[1]",
"actions": {
"allocate": {
"number_of_replicas": 2
}
}
}
}
}
}The min_age must be specified with a time unit. 10d means 10 days, which is correct for moving to warm phase after 10 days.
Fill both blanks to create a policy that moves an index to cold phase after 20 days and freezes it.
{
"policy": {
"phases": {
"cold": {
"min_age": "[1]",
"actions": {
"[2]": {}
}
}
}
}
}The min_age is set to 20d to start cold phase after 20 days. The freeze action freezes the index to save resources.
Fill all three blanks to define a policy with hot phase rollover at 25GB, warm phase after 7 days with 1 replica, and delete phase after 90 days.
{
"policy": {
"phases": {
"hot": {
"actions": {
"rollover": {
"max_size": "[1]"
}
}
},
"warm": {
"min_age": "[2]",
"actions": {
"allocate": {
"number_of_replicas": [3]
}
}
},
"delete": {
"min_age": "90d",
"actions": {
"delete": {}
}
}
}
}
}The hot phase rolls over at 25gb. The warm phase starts after 7d with 1 replica. The delete phase removes the index after 90 days.