# How to create daily Indices in elastic search 7.1.0?

**URL:** https://discuss.elastic.co/t/how-to-create-daily-indices-in-elastic-search-7-1-0/193338
**Category:** Elasticsearch
**Created:** [August 1, 2019, 1:58pm UTC](https://discuss.elastic.co/t/how-to-create-daily-indices-in-elastic-search-7-1-0/193338 "2019-08-01T13:58:14Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![irobot678](https://avatars.discourse-cdn.com/v4/letter/i/54ee81/32.png) [@irobot678](https://discuss.elastic.co/u/irobot678)
#### Post date: [August 1, 2019, 1:58pm UTC](https://discuss.elastic.co/t/how-to-create-daily-indices-in-elastic-search-7-1-0/193338/1 "2019-08-01T13:58:14Z")

</div>

Hi,  
I am using ELK stack version 7.1.0 and i send my logs using logstash.  
Now,

All my logs are getting into one index. I want create index daily basis and store those logs of that particular day in that particular index.

Previously when i used 6.8 version elasticsearch used to create a index each day on its own .

please help me solve it.

logstash.conf

> input {  
> file {  
> path =\> "/home/Desktop/a.log"  
> start\_position =\> "beginning"  
> }  
> }  
> filter {  
> grok {  
> match =\> { "message" =\> "%{TIMESTAMP\_ISO8601:date}%{GREEDYDATA:message}" } }  
> }  
> output {  
> elasticsearch { hosts =\> ["localhost:9200"] }  
> stdout { codec =\> rubydebug }  
> }

---

<div class="post-metadata">

### Author: ![Bernt\_Rostad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bernt\_Rostad](https://discuss.elastic.co/u/Bernt_Rostad)
#### Post date: [August 1, 2019, 2:18pm UTC](https://discuss.elastic.co/t/how-to-create-daily-indices-in-elastic-search-7-1-0/193338/2 "2019-08-01T14:18:46Z")

</div>

> [@irobot678](#):
>
> All my logs are getting into one index. I want create index daily basis

You should be able to achieve this by adding an **index** specification within the **elasticsearch** output element in your logstash.conf, for instance like this:

```
output {
    elasticsearch {
        hosts => ["localhost:9200"]
        index => "logstash-%{+YYYY.MM.dd}"
    }
   stdout { codec => rubydebug }
}

```

For more info see [Elasticsearch output plugin](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-index).

---

<div class="post-metadata">

### Author: ![irobot678](https://avatars.discourse-cdn.com/v4/letter/i/54ee81/32.png) [@irobot678](https://discuss.elastic.co/u/irobot678)
#### Post date: [August 2, 2019, 7:03am UTC](https://discuss.elastic.co/t/how-to-create-daily-indices-in-elastic-search-7-1-0/193338/3 "2019-08-02T07:03:24Z")

</div>

Thanks @Bernt_Rostad for the reply.

But it isn't helping i think my index name is getting overwritted by my index life cycle policy.

---

<div class="post-metadata">

### Author: ![Bernt\_Rostad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bernt\_Rostad](https://discuss.elastic.co/u/Bernt_Rostad)
#### Post date: [August 2, 2019, 7:37am UTC](https://discuss.elastic.co/t/how-to-create-daily-indices-in-elastic-search-7-1-0/193338/4 "2019-08-02T07:37:01Z")

</div>

> [@irobot678](#):
>
> But it isn't helping i think my index name is getting overwritted by my index life cycle policy.

Sorry to hear that, I have no experience with ILM yet so I'm afraid I can't help you there.

---

<div class="post-metadata">

### Author: ![irobot678](https://avatars.discourse-cdn.com/v4/letter/i/54ee81/32.png) [@irobot678](https://discuss.elastic.co/u/irobot678)
#### Post date: [August 14, 2019, 7:48pm UTC](https://discuss.elastic.co/t/how-to-create-daily-indices-in-elastic-search-7-1-0/193338/5 "2019-08-14T19:48:58Z")

</div>

Solved by making the following changes.

output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "logstash-%{+YYYY.MM.dd}"  
**manage\_template =\> false**  
user =\> elastic  
password =\> \*\*\*\*\*\*\*  
}  
}

---

<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: [September 11, 2019, 7:48pm UTC](https://discuss.elastic.co/t/how-to-create-daily-indices-in-elastic-search-7-1-0/193338/6 "2019-09-11T19:48:59Z")

</div>

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