# New data stream creation fails

**URL:** <https://discuss.elastic.co/t/new-data-stream-creation-fails/330481>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management, datastreams\
**Created:** [April 20, 2023, 8:57pm UTC](https://discuss.elastic.co/t/new-data-stream-creation-fails/330481 "2023-04-20T20:57:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [April 20, 2023, 8:57pm UTC](https://discuss.elastic.co/t/new-data-stream-creation-fails/330481/1 "2023-04-20T20:57:58Z")

</div>

I am trying to create my own data stream with ILM and index .ds but it is not working

Follwing worked

```auto
PUT _ilm/policy/sachin
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "rollover": {
            "max_primary_shard_size": "25gb",
            "max_age": "365d"
          }
        }
      }
    }
  }
}

```

following worked

```auto
PUT _index_template/sachin
{
  "index_patterns": ["sachin-*"],
  "data_stream": {},
  "priority": 500
}

```

This one failed with error  
`PUT _data_stream/sachin`

Error -

```auto
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "no matching index template found for data stream [sachin]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "no matching index template found for data stream [sachin]"
  },
  "status": 400
}

```

what am I doing wrong?

And if I do following it creates regular index

```auto
POST /sachin/_doc/
{
  "@timestamp": "2023-04-20T12:02:15.000Z"
}

```

---

<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:** [April 20, 2023, 9:24pm UTC](https://discuss.elastic.co/t/new-data-stream-creation-fails/330481/2 "2023-04-20T21:24:54Z")

</div>

> [@elasticforme](#):
>
> `"index_patterns": ["sachin-*"],`

> [@elasticforme](#):
>
> `POST /sachin/`

These don't seem to match?

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [April 20, 2023, 9:31pm UTC](https://discuss.elastic.co/t/new-data-stream-creation-fails/330481/3 "2023-04-20T21:31:37Z")

</div>

that is it. when I was reading pattern. I had old index pattern in my mind which is data view now.

---

<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:** [May 18, 2023, 9:31pm UTC](https://discuss.elastic.co/t/new-data-stream-creation-fails/330481/4 "2023-05-18T21:31:41Z")

</div>

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