# Full disk cleanup

**URL:** <https://discuss.elastic.co/t/full-disk-cleanup/9570>\
**Category:** Elasticsearch\
**Created:** [November 5, 2012, 11:20pm UTC](https://discuss.elastic.co/t/full-disk-cleanup/9570 "2012-11-05T23:20:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rob](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@Rob](https://discuss.elastic.co/u/Rob)\
**Post date:** [November 5, 2012, 11:20pm UTC](https://discuss.elastic.co/t/full-disk-cleanup/9570/1 "2012-11-05T23:20:32Z")

</div>

As of today I inherited an ubuntu logging server running graylog2. I went  
to log on to the web interface for the first time which gave an error when  
loading that there's no free disk space on the machine. Without throwing  
more space on the machine is there a good way to shrink down its usage?  
Also, how can I limit its disk usage in the future? The majority of usage  
is in /var/lib/elasticsearch/elasticsearch/nodes/0/indices/graylog2 and  
/var/lib/mongodb/journal.

--

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [November 6, 2012, 9:13am UTC](https://discuss.elastic.co/t/full-disk-cleanup/9570/2 "2012-11-06T09:13:20Z")

</div>

Hello Rob,

You can delete the graylog2 index with something like:

curl -XDELETE localhost:9200/graylog2

or all the data in ES with:

curl -XDELETE localhost:9200

If you want to limit the size of your indices, I guess you'll have to  
do that outside ES, with a cronjob or something. You can check the  
index size with the Indices Status API:

> **[Elastic — The Search AI Company](https://www.elastic.co)**
>
> Power insights and outcomes with The Elastic Search AI Platform. See into your data and find answers that matter with enterprise solutions designed to help you accelerate time to insight. Try Elastic ...

And if it's too big, you can delete documents matching a certain query:

> **[Elastic — The Search AI Company](https://www.elastic.co)**
>
> Power insights and outcomes with The Elastic Search AI Platform. See into your data and find answers that matter with enterprise solutions designed to help you accelerate time to insight. Try Elastic ...

Other things you can do:

- set a TTL to your logs, so they automatically get deleted once they  
get to certain "age":  
[Elastic — The Search AI Company | Elastic](http://www.elasticsearch.org/guide/reference/mapping/ttl-field.html)  
You'd set it using the PUT Mapping API:  
[Elastic — The Search AI Company | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-put-mapping.html)

- enable store-level compression:  
[Elastic — The Search AI Company | Elastic](http://www.elasticsearch.org/guide/reference/index-modules/store.html)  
You'd set it using the Indices Update Settings API:  
[Elastic — The Search AI Company | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings.html)

## Best regards, Radu

[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

On Tue, Nov 6, 2012 at 1:20 AM, Rob [rardies@elandatamakers.com](mailto:rardies@elandatamakers.com) wrote:

> As of today I inherited an ubuntu logging server running graylog2. I went  
> to log on to the web interface for the first time which gave an error when  
> loading that there's no free disk space on the machine. Without throwing  
> more space on the machine is there a good way to shrink down its usage?  
> Also, how can I limit its disk usage in the future? The majority of usage  
> is in /var/lib/elasticsearch/elasticsearch/nodes/0/indices/graylog2 and  
> /var/lib/mongodb/journal.
> 
> --

--

---

<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 6, 2017, 3:06am UTC](https://discuss.elastic.co/t/full-disk-cleanup/9570/3 "2017-07-06T03:06:03Z")

</div>


