# How can create datastream automatically

**URL:** <https://discuss.elastic.co/t/how-can-create-datastream-automatically/347531>\
**Category:** Logstash\
**Created:** [November 20, 2023, 1:02pm UTC](https://discuss.elastic.co/t/how-can-create-datastream-automatically/347531 "2023-11-20T13:02:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![baber1223](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/baber1223/32/83533_2.png) [@baber1223](https://discuss.elastic.co/u/baber1223)\
**Post date:** [November 20, 2023, 1:02pm UTC](https://discuss.elastic.co/t/how-can-create-datastream-automatically/347531/1 "2023-11-20T13:02:47Z")

</div>

This is my logstash output part :

after run , It will create index with the name of "TXT" but I want to create automatically datastream with all index templates and .. . Is that possible?

```auto
output{

  stdout{}
  elasticsearch {
   index => TXT
   hosts => ["https://IP:9200"]
   cacert => '/etc/logstash/certs/http_ca.crt'
   user => "elastic"
   password => "password"

}

}

```

---

<div class="post-metadata">

**Author:** ![baber1223](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/baber1223/32/83533_2.png) [@baber1223](https://discuss.elastic.co/u/baber1223)\
**Post date:** [November 20, 2023, 2:04pm UTC](https://discuss.elastic.co/t/how-can-create-datastream-automatically/347531/2 "2023-11-20T14:04:53Z")

</div>

Now according to above post it just creates an index and cannot create index template so we cannot create ILM . How can put it in that output ?

---

<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:** [December 18, 2023, 2:05pm UTC](https://discuss.elastic.co/t/how-can-create-datastream-automatically/347531/3 "2023-12-18T14:05:51Z")

</div>

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