# Filebeat setup. could not load template error

**URL:** https://discuss.elastic.co/t/filebeat-setup-could-not-load-template-error/337135
**Category:** Beats
**Tags:** filebeat
**Created:** [June 29, 2023, 12:18am UTC](https://discuss.elastic.co/t/filebeat-setup-could-not-load-template-error/337135 "2023-06-29T00:18:45Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![ashmistry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashmistry/32/122141_2.png) [@ashmistry](https://discuss.elastic.co/u/ashmistry)
#### Post date: [June 29, 2023, 12:18am UTC](https://discuss.elastic.co/t/filebeat-setup-could-not-load-template-error/337135/1 "2023-06-29T00:18:45Z")

</div>

Trying to setup filebeat on my stack. It's Elasticsearch OSS 7.10.2 with opensearch 2.4.1. I am using filebeat oss 7.12.1 and got a successful test output

```auto
[root]# filebeat test output
elasticsearch: https://xyz:9200...
  parse url... OK
  connection...
    parse host... OK
    dns lookup... OK
    addresses: xxx.x.x.x, xxx.x.x.x
    dial up... OK
  TLS...
    security... WARN server's certificate chain verification is disabled
    handshake... OK
    TLS version: TLSv1.3
    dial up... OK
  talk to server... OK
  version: 2.4.1

```

However when I ran filebeat setup -e I get this massive error complaining about not finding a template. I have just included a single line from it to save some space:

```auto
ERROR	instance/beat.go:971	Exiting: error loading template: could not load template. Elasticsearch returned: couldn't load template: 400 Bad Request:

```

What could be the cause of this? I found this [post](https://discuss.elastic.co/t/filebeat-fails-to-connect-because-template/188038), however

---

<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: [June 29, 2023, 12:18am UTC](https://discuss.elastic.co/t/filebeat-setup-could-not-load-template-error/337135/2 "2023-06-29T00:18:45Z")

</div>

7.10.2 is [EOL](https://www.elastic.co/support/eol) and no longer supported. Please upgrade ASAP.

(This is an automated response from your friendly Elastic bot. Please report this post if you have any suggestions or concerns :elasticheart: )

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [June 29, 2023, 1:08am UTC](https://discuss.elastic.co/t/filebeat-setup-could-not-load-template-error/337135/3 "2023-06-29T01:08:21Z")

</div>

> [@ashmistry](#):
>
> Trying to setup filebeat on my stack. It's Elasticsearch OSS 7.10.2 with opensearch 2.4.1. I am using filebeat oss 7.12.1 and got a successful test output

You need to use Filebeat 7.10.2, later versions won't work with Elasticsearch OSS or Opensearch because of the license change on version 7.11.

---

<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: [June 29, 2023, 1:08am UTC](https://discuss.elastic.co/t/filebeat-setup-could-not-load-template-error/337135/4 "2023-06-29T01:08:21Z")

</div>

OpenSearch/OpenDistro are AWS run products and differ from the original Elasticsearch and Kibana products that Elastic builds and maintains. You may need to contact them directly for further assistance.

(This is an automated response from your friendly Elastic bot. Please report this post if you have any suggestions or concerns :elasticheart: )

---

<div class="post-metadata">

### Author: ![ashmistry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashmistry/32/122141_2.png) [@ashmistry](https://discuss.elastic.co/u/ashmistry)
#### Post date: [June 29, 2023, 3:43pm UTC](https://discuss.elastic.co/t/filebeat-setup-could-not-load-template-error/337135/5 "2023-06-29T15:43:34Z")

</div>

Hi I set up Filebeat 7.10.2, and still got the same error message:

```auto
2023-06-29T10:39:29.461-0500	INFO	instance/beat.go:299	Setup Beat: filebeat; Version: 7.10.2
2023-06-29T10:39:29.461-0500	INFO	[index-management]	idxmgmt/std.go:184	Set output.elasticsearch.index to 'filebeat-7.10.2' as ILM is enabled.
2023-06-29T10:39:29.461-0500	INFO	eslegclient/connection.go:99	elasticsearch url: https://node1:9200
2023-06-29T10:39:29.461-0500	INFO	[publisher]	pipeline/module.go:113	Beat name: thenameofthebeat
2023-06-29T10:39:29.462-0500	INFO	eslegclient/connection.go:99	elasticsearch url: https://node1:9200
2023-06-29T10:39:29.466-0500	INFO	[esclientleg]	eslegclient/connection.go:314	Attempting to connect to Elasticsearch version 2.4.1
Overwriting ILM policy is disabled. Set `setup.ilm.overwrite: true` for enabling.

2023-06-29T10:39:29.468-0500	INFO	template/load.go:183	Existing template will be overwritten, as overwrite is enabled.
2023-06-29T10:39:29.551-0500	INFO	template/load.go:117	Try loading template filebeat-7.10.2 to Elasticsearch
2023-06-29T10:39:29.581-0500	ERROR	instance/beat.go:956	Exiting: error loading template: could not load template. Elasticsearch returned: couldn't load template: 400 Bad Request: {"error":{"root_cause"

```

---

<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: [June 29, 2023, 3:43pm UTC](https://discuss.elastic.co/t/filebeat-setup-could-not-load-template-error/337135/6 "2023-06-29T15:43:34Z")

</div>

Elasticsearch version 2.4.1 is [EOL](https://www.elastic.co/support/eol) and no longer supported. Please upgrade ASAP.

(This is an automated response from your friendly Elastic bot. Please report this post if you have any suggestions or concerns :elasticheart: )

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [June 29, 2023, 4:50pm UTC](https://discuss.elastic.co/t/filebeat-setup-could-not-load-template-error/337135/7 "2023-06-29T16:50:31Z")

</div>

> [@ashmistry](#):
>
> `2023-06-29T10:39:29.581-0500	ERROR	instance/beat.go:956	Exiting: error loading template: could not load template. Elasticsearch returned: couldn't load template: 400 Bad Request: {"error":{"root_cause"`

Please share the rest of the error.

---

<div class="post-metadata">

### Author: ![ashmistry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashmistry/32/122141_2.png) [@ashmistry](https://discuss.elastic.co/u/ashmistry)
#### Post date: [June 29, 2023, 6:38pm UTC](https://discuss.elastic.co/t/filebeat-setup-could-not-load-template-error/337135/8 "2023-06-29T18:38:14Z")

</div>

I didn't include all of it because it just goes on forever but if you need the full error let me know... I installed this by the way `filebeat-oss-7.10.2-x86_64.rpm`

```auto
2023-06-29T10:39:29.468-0500	INFO	template/load.go:183	Existing template will be overwritten, as overwrite is enabled.
2023-06-29T10:39:29.551-0500	INFO	template/load.go:117	Try loading template filebeat-7.10.2 to Elasticsearch
2023-06-29T10:39:29.581-0500	ERROR	instance/beat.go:956	Exiting: error loading template: could not load template. Elasticsearch returned: couldn't load template: 400 Bad Request: {"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters: [_default_ : {_meta={beat=filebeat, version=7.10.2}, dynamic_templates=[{labels={path_match=labels.*, mapping={type=keyword}, match_mapping_type=string}}, {container.labels={path_match=container.labels.*, mapping={type=keyword}, match_mapping_type=string}}, {fields={path_match=fields.*, mapping={type=keyword}, match_mapping_type=string}}, {docker.container.labels={path_match=docker.container.labels.*, mapping={type=keyword}, match_mapping_type=string}}, {kubernetes.labels.*={path_match=kubernetes.labels.*, mapping={type=keyword}, match_mapping_type=*}}, {kubernetes.annotations.*={path_match=kubernetes.annotations.*, mapping={type=keyword}, match_mapping_type=*}}, {docker.attrs={path_match=docker.attrs.*, mapping={type=keyword}, match_mapping_type=string}}, {kibana.log.meta={path_match=kibana.log.meta.*, mapping={type=keyword}, match_mapping_type=string}}, {strings_as_keyword={mapping={ignore_above=1024, index=not_analyzed, type=string}, match_mapping_type=string}}], date_detection=false, properties={container={properties={image={properties={name={ignore_above=1024, index=not_analyzed, type=string}, tag={ignore_above=1024, index=not_analyzed, type=string}}}, name={ignore_above=1024, index=not_analyzed, type=string}, runtime={ignore_above=1024, index=not_analyzed, type=string}, id={ignore_above=1024, index=not_analyzed, type=string}, labels={type=object}}}, kubernetes={properties={container={properties={image={ignore_above=1024, index=not_analyzed, type=string}, name={ignore_above=1024, index=not_analyzed, type=string}}}, node={properties={name={ignore_above=1024, index=not_analyzed, type=string}}}, pod={properties={uid={ignore_above=1024, index=not_analyzed, type=string}, name={ignore_above=1024, index=not_analyzed, type=string}}}, statefulset={properties={name={ignore_above=1024, index=not_analyzed, type=string}}}, namespace={ignore_above=1024, index=not_analyzed, type=string}, annotations={properties={*={type=object}}}, replicaset={properties={name={ignore_above=1024, index=not_analyzed, type=string}}}, labels={properties={*={type=object}}}, deployment={properties={name={ignore_above=1024, index=not_analyzed, type=string}}}}}, agent={properties={hostname={ignore_above=1024, index=not_analyzed, type=string}, build={properties={original={ignore_above=1024, index=not_analyzed, type=string}}}, name={ignore_above=1024, index=not_analyzed, type=string}, id={ignore_above=1024, index=not_analyzed,

```

---

<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 27, 2023, 8:38pm UTC](https://discuss.elastic.co/t/filebeat-setup-could-not-load-template-error/337135/9 "2023-07-27T20:38:54Z")

</div>

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