# Trying to create an index template to create a data stream

**URL:** <https://discuss.elastic.co/t/trying-to-create-an-index-template-to-create-a-data-stream/242089>\
**Category:** Elasticsearch\
**Created:** [July 21, 2020, 7:30pm UTC](https://discuss.elastic.co/t/trying-to-create-an-index-template-to-create-a-data-stream/242089 "2020-07-21T19:30:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![randoran](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@randoran](https://discuss.elastic.co/u/randoran)\
**Post date:** [July 21, 2020, 7:30pm UTC](https://discuss.elastic.co/t/trying-to-create-an-index-template-to-create-a-data-stream/242089/1 "2020-07-21T19:30:26Z")

</div>

I'm attempting to follow this tutorial  
[https://www.elastic.co/guide/en/elasticsearch/reference/7.x/getting-started-index-lifecycle-management.html](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/getting-started-index-lifecycle-management.html)  
And I am at the point where it says to Create an index template

```auto
PUT _index_template/timeseries_template
{
  "index_patterns": ["timeseries"],                   
  "data_stream": { },
  "template": {
    "settings": {
      "number_of_shards": 1,
      "number_of_replicas": 1,
      "index.lifecycle.name": "timeseries_policy"     
    }
  }
}

```

But I get this error

```auto
{
  "error" : {
    "root_cause" : [
      {
        "type" : "x_content_parse_exception",
        "reason" : "[3:3] [index_template] unknown field [data_stream]"
      }
    ],
    "type" : "x_content_parse_exception",
    "reason" : "[3:3] [index_template] unknown field [data_stream]"
  },
  "status" : 400
}

```

---

<div class="post-metadata">

**Author:** ![randoran](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@randoran](https://discuss.elastic.co/u/randoran)\
**Post date:** [July 21, 2020, 7:33pm UTC](https://discuss.elastic.co/t/trying-to-create-an-index-template-to-create-a-data-stream/242089/2 "2020-07-21T19:33:56Z")

</div>

It also says you can use the `Kibana Create template wizard` but haven't found that yet in Kibana.

---

<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:** [July 22, 2020, 11:31pm UTC](https://discuss.elastic.co/t/trying-to-create-an-index-template-to-create-a-data-stream/242089/3 "2020-07-22T23:31:50Z")

</div>

FYI 7.X is the master version of the docs, and can contain things that haven't been released yet. You should use [https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-index-lifecycle-management.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-index-lifecycle-management.html), or replace `current` for whatever version you are using.

What version are you running at the moment?

---

<div class="post-metadata">

**Author:** ![randoran](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@randoran](https://discuss.elastic.co/u/randoran)\
**Post date:** [July 22, 2020, 11:35pm UTC](https://discuss.elastic.co/t/trying-to-create-an-index-template-to-create-a-data-stream/242089/4 "2020-07-22T23:35:51Z")

</div>

I am using 7.8, I will try again using this documentation. thank you

---

<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:** [August 19, 2020, 11:36pm UTC](https://discuss.elastic.co/t/trying-to-create-an-index-template-to-create-a-data-stream/242089/5 "2020-08-19T23:36:17Z")

</div>

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