Elasticsearch ILM Error policy does not exists

Viewed 885

So this is my index template:

{
  "net-stat-template" : {
    "order" : 0,
    "index_patterns" : [
      "net-stat-*"
    ],
    "settings" : {
      "index" : {
        "lifecycle" : {
          "name" : "net-stat",
          "rollover_alias" : "net-stat"
        },
        "routing" : {
          "allocation" : {
            "require" : {
              "data" : "hot"
            }
          }
        },
        "refresh_interval" : "15s",
        "number_of_shards" : "1",
        "number_of_replicas" : "0"
      }
    },
    "mappings" : { },
    "aliases" : { }
  }
}

and this is my ilm/policy :

"net-stat" : {
    "version" : 1,
    "modified_date" : "2020-05-10T19:20:18.979Z",
    "policy" : {
      "phases" : {
        "hot" : {
          "min_age" : "0ms",
          "actions" : {
            "rollover" : {
              "max_size" : "50gb",
              "max_age" : "5d"
            },
            "set_priority" : {
              "priority" : 50
            }
          }
        },
        "delete" : {
          "min_age" : "10d",
          "actions" : {
            "delete" : { }
          }
        },
        "warm" : {
          "min_age" : "0ms",
          "actions" : {
            "allocate" : {
              "number_of_replicas" : 0,
              "include" : { },
              "exclude" : { },
              "require" : {
                "data" : "warm"
              }
            },
            "set_priority" : {
              "priority" : 50
            }
          }
        }
      }
    }
  }

but it's doesn't delete indexes with more than 10 days old and when I try GET net-stat-2020.04.20/_ilm/explain it returns:

{
  "indices" : {
    "net-stat-2020.04.20" : {
      "index" : "net-stat-2020.04.20",
      "managed" : true,
      "policy" : "netstat",
      "step_info" : {
        "type" : "illegal_argument_exception",
        "reason" : "policy [netstat] does not exist"
      }
    }
  }
}

I'm not sure where this netstat came from and also when I try POST /net-stat-2020.04.20/_ilm/retry it returns error :

"type": "illegal_argument_exception",
"reason": "cannot retry an action for an index [net-stat-2020.04.20] that has not encountered an error when running a Lifecycle Policy"

Is there something I'm missing or my setting are somehow wrong?

0 Answers
Related