Edit System Template with API call?

I want to create ILP to elasticsearch monitoring index, i have ILP created, and now i want to link it to the System template ".monitoring-es" but in order to have everything persistent and ready to be reused, we implement those with API calls (curl post request with json template in it).

My goal is to get ".monitoring-es" template in the way where i can just add "index.lifecycle.name" and "index.lifecycle.rollover_alias" in the settings and apply it again.

I tried with curl http://IP/_template/.monitoring-es?pretty=true > template.json
But this format is not something that i can reapply after that with
curl -XPUT -H 'Content-Type: application/json' http://IP/_template/template.json

How can export this template in the way that i can edit it and reaplly it?

Can you clarify what ILP is?

It's a policy that rotate index and deletes it after a couple of days:

{
  "policy": {
    "phases": {
      "hot": {
        "actions": {
          "rollover": {
            "max_size": "120gb"
          },
          "set_priority": {
            "priority": 100
          }
        },
        "min_age": "0ms"
      },
      "delete": {
        "min_age": "60d",
        "actions": {
          "delete": {}
        }
      }
    }
  }
}

My pain is to get the ".monitorig-es" template in a way that i can add 2 settings and put it again with curl.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.