# How to delete old /var/log/elasticsearch

**URL:** <https://discuss.elastic.co/t/how-to-delete-old-var-log-elasticsearch/236501>\
**Category:** Elasticsearch\
**Created:** [June 10, 2020, 11:18am UTC](https://discuss.elastic.co/t/how-to-delete-old-var-log-elasticsearch/236501 "2020-06-10T11:18:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)\
**Post date:** [June 10, 2020, 11:18am UTC](https://discuss.elastic.co/t/how-to-delete-old-var-log-elasticsearch/236501/1 "2020-06-10T11:18:19Z")

</div>

Hi there,

I am running Elasticsearch 7.6.2. I want to cleanup my logs in /var/log/elasticsearch.  
By default elasticsearch is rotating its logs. But they stay there forever.

What is the easiest way to delete logs after 7 or 14 days? I also want to delete the gc.log.\*. They are not date suffixed, but I only want to keep the last 7 files or so.

Thanks, Andreas

---

<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:** [July 8, 2020, 11:18am UTC](https://discuss.elastic.co/t/how-to-delete-old-var-log-elasticsearch/236501/2 "2020-07-08T11:18:24Z")

</div>

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