# Template keep adding itself in loop

**URL:** <https://discuss.elastic.co/t/template-keep-adding-itself-in-loop/222125>\
**Category:** Elasticsearch\
**Created:** [March 4, 2020, 4:57pm UTC](https://discuss.elastic.co/t/template-keep-adding-itself-in-loop/222125 "2020-03-04T16:57:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![stack](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@stack](https://discuss.elastic.co/u/stack)\
**Post date:** [March 4, 2020, 4:57pm UTC](https://discuss.elastic.co/t/template-keep-adding-itself-in-loop/222125/1 "2020-03-04T16:57:01Z")

</div>

Hello,

I have setup a template trough my winlogbeat file and i wanted to update it on Kibana by adding an alias. Everytime i added the alias i noticed that the change would apply, but 5 seconds later it would disappeir.

Turn out that one of my node keep re-adding the template every 5 seconds, overwriting my changes (seeing it on the cmd console of elasticsearch, i'm running it on windows) . I tried rebooting my nodes but it still happend. I deleted the template and updated my winlogbeat conf file to

> setup.template.overwrite: false

as part of :

```
setup.template.enabled: true
setup.template.overwrite: false
setup.template.name: "winlogbeat"
setup.template.pattern: "winlogbeat-*"
setup.ilm.enabled: false
setup.ilm.policy_name: "winlogbeat-hot-warm-30daysoflogs"
setup.ilm.rollover_alias: "winlogbeat-alias"
setup.ilm.pattern: "{now/d{dd.MM.yyyy}}-000001"
setup.ilm.check_exists: false

```

And made the setup again. However template keep overwriting in loop. I couldn't find help on that subject, do you guys have an idea ?

Thank you !

---

<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:** [March 5, 2020, 7:35pm UTC](https://discuss.elastic.co/t/template-keep-adding-itself-in-loop/222125/2 "2020-03-05T19:35:52Z")

</div>

Can you share the template and the log lines you are seeing of this behaviour?

---

<div class="post-metadata">

**Author:** ![stack](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@stack](https://discuss.elastic.co/u/stack)\
**Post date:** [March 5, 2020, 10:11pm UTC](https://discuss.elastic.co/t/template-keep-adding-itself-in-loop/222125/3 "2020-03-05T22:11:15Z")

</div>

Hello,

I made a screenshot of the log output from console: [  
https://i.imgur.com/ui0Zedd.png](https://discuss.elastic.co/uploads/short-url/q6yiOkq1JPOn2Is9DLd8cLRWsvc.png)

 ![](https://us1.discourse-cdn.com/elastic/original/3X/b/6/b6f629f78130e85dc9cc4ec38c61e90662c65b9e.png)

The template is the default winlogbeat template, i'm only changing it's name because i changed my index name to be winlogbeat only (no beat version in the index).

---

<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:** [March 5, 2020, 10:36pm UTC](https://discuss.elastic.co/t/template-keep-adding-itself-in-loop/222125/4 "2020-03-05T22:36:32Z")

</div>

Please don't post pictures of text, they are difficult to read, impossible to search and some people may not be even able to see them 🙂

Can you post the template? Feel free to use gist/pastebin/etc.

---

<div class="post-metadata">

**Author:** ![stack](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@stack](https://discuss.elastic.co/u/stack)\
**Post date:** [March 6, 2020, 10:45am UTC](https://discuss.elastic.co/t/template-keep-adding-itself-in-loop/222125/5 "2020-03-06T10:45:17Z")

</div>

Sorry for the picture, it seemed easier to me

```
[2020-03-06T11:38:48,506][INFO][o.e.c.m.MetaDataIndexTemplateService] [ELK001] adding template [winlogbeat] for index patterns [winlogbeat-*]
[2020-03-06T11:38:53,302][INFO][o.e.c.m.MetaDataIndexTemplateService] [ELK001] adding template [metricbeat] for index patterns [metricbeat-*]
[2020-03-06T11:38:56,819][DEBUG][o.e.a.s.m.TransportMasterNodeAction] [ELK001] Get stats for datafeed '_all'
[2020-03-06T11:39:01,081][INFO][o.e.c.m.MetaDataIndexTemplateService] [ELK001] adding template [winlogbeat] for index patterns [winlogbeat-*]
[2020-03-06T11:39:06,788][DEBUG][o.e.a.s.m.TransportMasterNodeAction] [ELK001] Get stats for datafeed '_all'
[2020-03-06T11:39:07,879][INFO][o.e.c.m.MetaDataIndexTemplateService] [ELK001] adding template [metricbeat] for index patterns [metricbeat-*]
[2020-03-06T11:39:16,717][INFO][o.e.c.m.MetaDataIndexTemplateService] [ELK001] adding template [winlogbeat] for index patterns [winlogbeat-*]
[2020-03-06T11:39:16,795][DEBUG][o.e.a.s.m.TransportMasterNodeAction] [ELK001] Get stats for datafeed '_all'
[2020-03-06T11:39:22,818][INFO][o.e.c.m.MetaDataIndexTemplateService] [ELK001] adding template [winlogbeat] for index patterns [winlogbeat-*]
[2020-03-06T11:39:23,053][INFO][o.e.c.m.MetaDataIndexTemplateService] [ELK001] adding template [metricbeat] for index patterns [metricbeat-*]
[2020-03-06T11:39:26,769][DEBUG][o.e.a.s.m.TransportMasterNodeAction] [ELK001] Get stats for datafeed '_all'
[2020-03-06T11:39:28,007][INFO][o.e.c.m.MetaDataIndexTemplateService] [ELK001] adding template [metricbeat] for index patterns [metricbeat-*]

```

Here's the template [https://pastebin.com/ZNANasPZ](https://pastebin.com/ZNANasPZ)

This is the first time i open this file, first thing i notice on top is the index pattern: winlogbeat.7.5.1 which in my conf file isn't what i want anymore. Could it be the root cause ?

---

<div class="post-metadata">

**Author:** ![stack](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@stack](https://discuss.elastic.co/u/stack)\
**Post date:** [March 17, 2020, 4:00pm UTC](https://discuss.elastic.co/t/template-keep-adding-itself-in-loop/222125/6 "2020-03-17T16:00:21Z")

</div>

I decided to move all my nodes to CentOS since i was having lot of issues with Windows and i realised i had no advantages from being on Windows.

On my new cluster i can see that my agents still override my template on a regularer bassis.

However, it doesn't matter anymore because i decided to not use custom index/template anymore, juste use the default template. This way, my agents may keep overiding the template, it doesn't matter because i don't need to make any changes to that template.

---

<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:** [April 14, 2020, 4:00pm UTC](https://discuss.elastic.co/t/template-keep-adding-itself-in-loop/222125/7 "2020-04-14T16:00:28Z")

</div>

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