# Need help to update es6 template to es7

**URL:** https://discuss.elastic.co/t/need-help-to-update-es6-template-to-es7/266409
**Category:** Elasticsearch
**Created:** [March 5, 2021, 9:27pm UTC](https://discuss.elastic.co/t/need-help-to-update-es6-template-to-es7/266409 "2021-03-05T21:27:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![michbsd](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@michbsd](https://discuss.elastic.co/u/michbsd)
#### Post date: [March 5, 2021, 9:27pm UTC](https://discuss.elastic.co/t/need-help-to-update-es6-template-to-es7/266409/1 "2021-03-05T21:27:38Z")

</div>

Hi,

I have been using varnishstatbeat in the past to ship varnish statistics to Elasticsearch.  
I am currently in the process of upgrading my cluster to 7.x - and there is no es7 template for the varnishstatbeat project.

Here is the current es6 template:

```auto
{
  "mappings": {
    "_default_": {
      "_all": {
        "norms": {
          "enabled": false
        }
      },
      "_meta": {
        "version": "6.0.0-alpha1"
      },
      "date_detection": false,
      "dynamic_templates": [
        {
          "strings_as_keyword": {
            "mapping": {
              "ignore_above": 1024,
              "index": false,
              "type": "text"
            },
            "match_mapping_type": "string"
          }
        }
      ],
      "properties": {
        "@timestamp": {
          "type": "date"
        },
        "beat": {
          "properties": {
            "hostname": {
              "index": false,
              "type": "text"
            },
            "name": {
              "index": false,
              "type": "text"
            },
            "version": {
              "index": false,
              "type": "text"
            }
          }
        },
        "counter": {
          "type": "long"
        },
        "fields": {
          "properties": {}
        },
        "meta": {
          "properties": {
            "cloud": {
              "properties": {
                "availability_zone": {
                  "index": false,
                  "type": "text"
                },
                "instance_id": {
                  "index": false,
                  "type": "text"
                },
                "machine_type": {
                  "index": false,
                  "type": "text"
                },
                "project_id": {
                  "index": false,
                  "type": "text"
                },
                "provider": {
                  "index": false,
                  "type": "text"
                },
                "region": {
                  "index": false,
                  "type": "text"
                }
              }
            }
          }
        },
        "tags": {
          "index": false,
          "type": "text"
        }
      }
    }
  },
  "order": 0,
  "settings": {
    "index.refresh_interval": "5s"
  },
  "template": "varnishstatbeat-*"
}

```

I get the following error when I try to POST it into es7:

```auto
2021/03/05 10:32:32.951844 client.go:673: DBG PUT http://172.16.0.166:9200/_template/varnishstatbeat.template-es6x.json map[mappings:map[_default_:map[properties:map[@timestamp:map[type:date] beat:map[properties:map[name:map[index:false type:text] version:map[index:false type:text] hostname:map[index:false type:text]]] counter:map[type:long] fields:map[properties:map[]] meta:map[properties:map[cloud:map[properties:map[project_id:map[index:false type:text] provider:map[index:false type:text] region:map[index:false type:text] availability_zone:map[index:false type:text] instance_id:map[type:text index:false] machine_type:map[index:false type:text]]]]] tags:map[index:false type:text]] _all:map[norms:map[enabled:false]] _meta:map[version:6.0.0-alpha1] date_detection:false dynamic_templates:[map[strings_as_keyword:map[mapping:map[ignore_above:1024 index:false type:text] match_mapping_type:string]]]]] order:0 settings:map[index.refresh_interval:5s] template:varnishstatbeat-*]
2021/03/05 10:32:32.959299 sync_worker.go:87: ERR Connect failed with: Connection marked as failed because the onConnect callback failed: Could not load template: couldn't load template: couldn't load json. Error: 400 Bad Request. Response body: {"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters: [_default_ : {_meta={version=6.0.0-alpha1}, dynamic_templates=[{strings_as_keyword={mapping={ignore_above=1024, index=false, type=text}, match_mapping_type=string}}], _all={norms={enabled=false}}, date_detection=false, properties={@timestamp={type=date}, meta={properties={cloud={properties={machine_type={index=false, type=text}, availability_zone={index=false, type=text}, instance_id={index=false, type=text}, project_id={index=false, type=text}, provider={index=false, type=text}, region={index=false, type=text}}}}}, beat={properties={hostname={index=false, type=text}, name={index=false, type=text}, version={index=false, type=text}}}, counter={type=long}, fields={properties={}}, tags={index=false, type=text}}}]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [_doc]: Root mapping definition has unsupported parameters: [_default_ : {_meta={version=6.0.0-alpha1}, dynamic_templates=[{strings_as_keyword={mapping={ignore_above=1024, index=false, type=text}, match_mapping_type=string}}], _all={norms={enabled=false}}, date_detection=false, properties={@timestamp={type=date}, meta={properties={cloud={properties={machine_type={index=false, type=text}, availability_zone={index=false, type=text}, instance_id={index=false, type=text}, project_id={index=false, type=text}, provider={index=false, type=text}, region={index=false, type=text}}}}}, beat={properties={hostname={index=false, type=text}, name={index=false, type=text}, version={index=false, type=text}}}, counter={type=long}, fields={properties={}}, tags={index=false, type=text}}}]","caused_by":{"type":"mapper_parsing_exception","reason":"Root mapping definition has unsupported parameters: [_default_ : {_meta={version=6.0.0-alpha1}, dynamic_templates=[{strings_as_keyword={mapping={ignore_above=1024, index=false, type=text}, match_mapping_type=string}}], _all={norms={enabled=false}}, date_detection=false, properties={@timestamp={type=date}, meta={properties={cloud={properties={machine_type={index=false, type=text}, availability_zone={index=false, type=text}, instance_id={index=false, type=text}, project_id={index=false, type=text}, provider={index=false, type=text}, region={index=false, type=text}}}}}, beat={properties={hostname={index=false, type=text}, name={index=false, type=text}, version={index=false, type=text}}}, counter={type=long}, fields={properties={}}, tags={index=false, type=text}}}]"}},"status":400}
^C2021/03/05 10:32:34.091579 service.go:33: DBG Received sigterm/sigint, stopping

```

Any pointers as to what I need to change in the template to get this working would be greatly appreciated.

thanks

```auto

```

---

<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 2, 2021, 9:28pm UTC](https://discuss.elastic.co/t/need-help-to-update-es6-template-to-es7/266409/2 "2021-04-02T21:28:14Z")

</div>

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