New data stream creation fails

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

Follwing worked

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

following worked

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

This one failed with error
PUT _data_stream/sachin

Error -

{
  "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

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

These don't seem to match?

1 Like

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

1 Like

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