# New to it all. Would like a rotating 7 indexes from logstash to Elastisearch

**URL:** <https://discuss.elastic.co/t/new-to-it-all-would-like-a-rotating-7-indexes-from-logstash-to-elastisearch/82434>\
**Category:** Logstash\
**Created:** [April 14, 2017, 5:29pm UTC](https://discuss.elastic.co/t/new-to-it-all-would-like-a-rotating-7-indexes-from-logstash-to-elastisearch/82434 "2017-04-14T17:29:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![runatyr](https://avatars.discourse-cdn.com/v4/letter/r/a587f6/32.png) [@runatyr](https://discuss.elastic.co/u/runatyr)\
**Post date:** [April 14, 2017, 5:29pm UTC](https://discuss.elastic.co/t/new-to-it-all-would-like-a-rotating-7-indexes-from-logstash-to-elastisearch/82434/1 "2017-04-14T17:29:46Z")

</div>

Hello:  
First off... Wow... These products are amazing!

I have a single logstash source and a single elasticsearch/kibana source set up. All on the same server.  
(Yes Still learning it all 🙂 )

I would like to have my logstash and elasticsearch configuration set up so I create a new index every day and  
keep only the 7 most recent indices in elasticsearch.

Do I accomplish this by modifying elasticsearch and logstash both?  
What is a simple automated solution

Any help is greatly appreciated

-Runatyr

my logstash conf file below

input {  
file {  
path =\> "/var/log/logfile.log"  
start\_position =\> "beginning"  
}  
}

output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
}  
stdout { codec =\> rubydebug }  
}

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 16, 2017, 10:49am UTC](https://discuss.elastic.co/t/new-to-it-all-would-like-a-rotating-7-indexes-from-logstash-to-elastisearch/82434/2 "2017-04-16T10:49:16Z")

</div>

Logstash by default creates a new index every day, so that should already happen. In order to delete indices that are older than 7 days, you can use [Curator](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.0/index.html).

---

<div class="post-metadata">

**Author:** ![runatyr](https://avatars.discourse-cdn.com/v4/letter/r/a587f6/32.png) [@runatyr](https://discuss.elastic.co/u/runatyr)\
**Post date:** [April 25, 2017, 5:47pm UTC](https://discuss.elastic.co/t/new-to-it-all-would-like-a-rotating-7-indexes-from-logstash-to-elastisearch/82434/3 "2017-04-25T17:47:34Z")

</div>

Many thanks!

---

<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 23, 2017, 6:02pm UTC](https://discuss.elastic.co/t/new-to-it-all-would-like-a-rotating-7-indexes-from-logstash-to-elastisearch/82434/4 "2017-05-23T18:02:22Z")

</div>

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