How to delete old /var/log/elasticsearch

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

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