# Index Templates... where do they come from?

**URL:** https://discuss.elastic.co/t/index-templates-where-do-they-come-from/184401
**Category:** Elasticsearch
**Created:** [June 5, 2019, 3:01pm UTC](https://discuss.elastic.co/t/index-templates-where-do-they-come-from/184401 "2019-06-05T15:01:07Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![eskorte](https://avatars.discourse-cdn.com/v4/letter/e/dfb087/32.png) [@eskorte](https://discuss.elastic.co/u/eskorte)
#### Post date: [June 5, 2019, 3:01pm UTC](https://discuss.elastic.co/t/index-templates-where-do-they-come-from/184401/1 "2019-06-05T15:01:07Z")

</div>

Hello!

I see three index templates _filebeat-6.7.1_, _filebeat-7.0.0_ and _filebeat-7.0.1_. Each with corresponding index patterns like _filebeat-7.0.1-_ \*.  
Until now my logstash config was set to output.elasticsearch.index =\> **filebeat-%{+yyyy.MM.dd}** - so the templates did not match. Now I set the index to **filebeat-%{[agent][version]}-%{+yyyy.MM.dd}**. But now I use version 7.1.0 and new indexes are called like **filebeat-7.1.0-2019.06.05**. There is no template for this version. So my question is: where does these templates come from, and how do I get one for version 7.1.0?

Best regards,  
Sebastian

---

<div class="post-metadata">

### Author: ![eskorte](https://avatars.discourse-cdn.com/v4/letter/e/dfb087/32.png) [@eskorte](https://discuss.elastic.co/u/eskorte)
#### Post date: [June 6, 2019, 8:27am UTC](https://discuss.elastic.co/t/index-templates-where-do-they-come-from/184401/2 "2019-06-06T08:27:32Z")

</div>

Found it, filebeat setup:

```
# filebeat setup --template -E output.logstash.enabled=false -E 'output.elasticsearch.hosts=["localhost:9200"]' -E "output.elasticsearch.user=elastic" -E "output.elasticsearch.password=xxx"
Exiting: Couldn't connect to any of the configured Elasticsearch hosts. Errors: [Error connection to Elasticsearch http://localhost:9200: 401 Unauthorized: {"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [] for REST request [/]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}}],"type":"security_exception","reason":"unable to authenticate user [] for REST request [/]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}},"status":401}]

```

I wonder why its "Unauthorized"...

---

<div class="post-metadata">

### Author: ![eskorte](https://avatars.discourse-cdn.com/v4/letter/e/dfb087/32.png) [@eskorte](https://discuss.elastic.co/u/eskorte)
#### Post date: [June 6, 2019, 8:52am UTC](https://discuss.elastic.co/t/index-templates-where-do-they-come-from/184401/3 "2019-06-06T08:52:01Z")

</div>

Done. Workaround:

```
# filebeat export template > filebeat.template.json
# curl -XPUT -u "elastic:xxx" -H 'Content-Type: application/json' http://localhost:9200/_template/filebeat-7.1.0 -d@filebeat.template.json
```

---

<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 4, 2019, 8:52am UTC](https://discuss.elastic.co/t/index-templates-where-do-they-come-from/184401/4 "2019-07-04T08:52:06Z")

</div>

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