# Edit System Template with API call?

**URL:** <https://discuss.elastic.co/t/edit-system-template-with-api-call/276655>\
**Category:** Elasticsearch\
**Created:** [June 22, 2021, 1:09pm UTC](https://discuss.elastic.co/t/edit-system-template-with-api-call/276655 "2021-06-22T13:09:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kodka](https://avatars.discourse-cdn.com/v4/letter/k/da6949/32.png) [@kodka](https://discuss.elastic.co/u/kodka)\
**Post date:** [June 22, 2021, 1:09pm UTC](https://discuss.elastic.co/t/edit-system-template-with-api-call/276655/1 "2021-06-22T13:09:37Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 22, 2021, 10:16pm UTC](https://discuss.elastic.co/t/edit-system-template-with-api-call/276655/2 "2021-06-22T22:16:49Z")

</div>

Can you clarify what ILP is?

---

<div class="post-metadata">

**Author:** ![kodka](https://avatars.discourse-cdn.com/v4/letter/k/da6949/32.png) [@kodka](https://discuss.elastic.co/u/kodka)\
**Post date:** [June 23, 2021, 6:47am UTC](https://discuss.elastic.co/t/edit-system-template-with-api-call/276655/3 "2021-06-23T06:47:00Z")

</div>

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

```auto
{
  "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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 21, 2021, 6:48am UTC](https://discuss.elastic.co/t/edit-system-template-with-api-call/276655/4 "2021-07-21T06:48:00Z")

</div>

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