# How to delete docs.deleted from ELK?

**URL:** https://discuss.elastic.co/t/how-to-delete-docs-deleted-from-elk/338597
**Category:** Elasticsearch
**Created:** [July 17, 2023, 5:32pm UTC](https://discuss.elastic.co/t/how-to-delete-docs-deleted-from-elk/338597 "2023-07-17T17:32:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Yuri\_Pires](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuri_pires/32/123549_2.png) [@Yuri\_Pires](https://discuss.elastic.co/u/Yuri_Pires)
#### Post date: [July 17, 2023, 5:32pm UTC](https://discuss.elastic.co/t/how-to-delete-docs-deleted-from-elk/338597/1 "2023-07-17T17:32:34Z")

</div>

Hello, in this logstash index I used the delete\_by\_query endpoint to clean old logs from storage, I was successful in this step, but I found that the docs are still on the HD and I want to delete them to free up space.

```auto
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open logstash adZNy34GTRu-sLGfl6jMDQ 1 1 476661826 7623516 58.4gb 58.4gb

```

I tried running the following command but it was unsuccessful to free up space:

```auto
curl -XPOST "http://localhost:9200/logstash/_forcemerge?only_expunge_deletes=true" -u elastic:xxxx

```

After that, I tried to run the command:

```auto
 curl -XPOST "http://localhost:9200/logstash/_forcemerge?max_num_segments=1" -u elastic:xxx

```

And the error was:

```auto
{"_shards":{"total":2,"successful":0,"failed":1,"failures":[{"shard":0,"index":"logstash","status":"INTERNAL_SERVER_ERROR","reason":{"type":"illegal_state_exception","reason":"this writer hit an unrecoverable error; cannot complete forceMerge","caused_by":{"type":"i_o_exception","reason":"No space left on device","suppressed":[{"type":"i_o_exception","reason":"No space left on device","suppressed":[{"type":"i_o_exception","reason":"No space left on device"},{"type":"i_o_exception","reason":"No space left on device","suppressed":[{"type":"i_o_exception","reason":"No space left on device"},{"type":"i_o_exception","reason":"No space left on device","suppressed":[{"type":"i_o_exception","reason":"No space left on device"}]}]}]}]}}}]}}

```

Has anyone gone through something similar to help me?

---

<div class="post-metadata">

### Author: ![PodarcisMuralis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/podarcismuralis/32/122606_2.png) [@PodarcisMuralis](https://discuss.elastic.co/u/PodarcisMuralis)
#### Post date: [July 17, 2023, 6:50pm UTC](https://discuss.elastic.co/t/how-to-delete-docs-deleted-from-elk/338597/2 "2023-07-17T18:50:01Z")

</div>

It seems that you are facing a "No space left on device" error when trying to force merge the index in Elasticsearch. This error occurs because the storage device where Elasticsearch is storing its data has run out of space.

When you perform a force merge on an index with the `max_num_segments=1`, Elasticsearch tries to reduce the number of segments by merging them together. However, this process requires additional disk space for temporary storage during the merging process, and in your case, there is not enough free space on the device to complete the operation.

So i would try df on linux to check how much space I have. Then I would free up some space after that, try force merge again.

```auto
curl -XPOST "http://localhost:9200/logstash/_forcemerge?max_num_segments=1" -u elastic:your_password

```

---

<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 14, 2023, 6:50pm UTC](https://discuss.elastic.co/t/how-to-delete-docs-deleted-from-elk/338597/3 "2023-08-14T18:50:20Z")

</div>

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