# Clean logs after 7 days

**URL:** https://discuss.elastic.co/t/clean-logs-after-7-days/92020
**Category:** Elasticsearch
**Created:** [July 6, 2017, 5:38am UTC](https://discuss.elastic.co/t/clean-logs-after-7-days/92020 "2017-07-06T05:38:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Pandiyan\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pandiyan_m/32/19404_2.png) [@Pandiyan\_M](https://discuss.elastic.co/u/Pandiyan_M)
#### Post date: [July 6, 2017, 5:38am UTC](https://discuss.elastic.co/t/clean-logs-after-7-days/92020/1 "2017-07-06T05:38:21Z")

</div>

Hi,

I have installed EK on one server, Logstash on another server, Filebeat on destination server.

All server like File, Email, Web server logs are generated daily which are tailing using filebeat to logstash followed by elastic search.

After parsing logs from filebeat server to elastic search, after every 7 days i would like to archive logs to s3 from elastic search, how to achieve it ?

🙂

---

<div class="post-metadata">

### Author: ![ritchierich](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ritchierich/32/4329_2.png) [@ritchierich](https://discuss.elastic.co/u/ritchierich)
#### Post date: [July 6, 2017, 6:40am UTC](https://discuss.elastic.co/t/clean-logs-after-7-days/92020/2 "2017-07-06T06:40:41Z")

</div>

You need to start with the S3 Repository plugin. Its well documented on how to setup permissions and create the repository.

[https://www.elastic.co/guide/en/elasticsearch/plugins/5.4/repository-s3.html](https://www.elastic.co/guide/en/elasticsearch/plugins/5.4/repository-s3.html)

Once you get started you should checkout Curator to help automate the process. [https://www.elastic.co/guide/en/elasticsearch/client/curator/current/index.html](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/index.html)

Good Luck!!

---

<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: [August 3, 2017, 6:40am UTC](https://discuss.elastic.co/t/clean-logs-after-7-days/92020/3 "2017-08-03T06:40:57Z")

</div>

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