# Can I blow out elasticsearch log directory "/var/log/elasticsearch" or is that a no no?

**URL:** <https://discuss.elastic.co/t/can-i-blow-out-elasticsearch-log-directory-var-log-elasticsearch-or-is-that-a-no-no/230780>\
**Category:** Elasticsearch\
**Created:** [May 2, 2020, 12:52am UTC](https://discuss.elastic.co/t/can-i-blow-out-elasticsearch-log-directory-var-log-elasticsearch-or-is-that-a-no-no/230780 "2020-05-02T00:52:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![syost](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@syost](https://discuss.elastic.co/u/syost)\
**Post date:** [May 2, 2020, 12:52am UTC](https://discuss.elastic.co/t/can-i-blow-out-elasticsearch-log-directory-var-log-elasticsearch-or-is-that-a-no-no/230780/1 "2020-05-02T00:52:07Z")

</div>

I would like to monitor elasticsearch logs using filebeat and I see in my "elasticsearch.yml" these are stored...  
`path.logs: /var/log/elasticsearch`

There's a bunch of stuff in here and I would just like to delete everything to help save space on my EC2 I'm testing in. May I do this?

Secondly, I see that in this directory there are several extensions being...

- json.gz
- json
- log.gz
- log

Are the "gz" just compressed versions of old logs? I'm nervous about these json files in here. I don't want to delete them if their needed.

---

<div class="post-metadata">

**Author:** ![Luca\_Belluccini](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luca_belluccini/32/33239_2.png) [@Luca\_Belluccini](https://discuss.elastic.co/u/Luca_Belluccini)\
**Post date:** [May 2, 2020, 12:59am UTC](https://discuss.elastic.co/t/can-i-blow-out-elasticsearch-log-directory-var-log-elasticsearch-or-is-that-a-no-no/230780/2 "2020-05-02T00:59:40Z")

</div>

It is possible to [change the configuration of `log4j2.properties` file](https://www.elastic.co/guide/en/elasticsearch/reference/master/logging.html) to auto-remove and/or auto-compress log files.

It is possible to reduce the amount of data kept to a maximum amount.

The `gz` logs are the compressed files which have been already rolled by size or time.

---

<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 30, 2020, 12:59am UTC](https://discuss.elastic.co/t/can-i-blow-out-elasticsearch-log-directory-var-log-elasticsearch-or-is-that-a-no-no/230780/3 "2020-05-30T00:59:44Z")

</div>

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