# Issues with log rotation - Filebeat lock logs file

**URL:** <https://discuss.elastic.co/t/issues-with-log-rotation-filebeat-lock-logs-file/327565>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [March 13, 2023, 2:26pm UTC](https://discuss.elastic.co/t/issues-with-log-rotation-filebeat-lock-logs-file/327565 "2023-03-13T14:26:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![akhil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akhil/32/116231_2.png) [@akhil](https://discuss.elastic.co/u/akhil)\
**Post date:** [March 13, 2023, 2:26pm UTC](https://discuss.elastic.co/t/issues-with-log-rotation-filebeat-lock-logs-file/327565/1 "2023-03-13T14:26:24Z")

</div>

Hi All,

We are having some issues with filbeat. Actually filebeat is locking a logs file and because of this the log rotation is not working. The data is keep getting ingested in the same file.

Every time we have to restart the filebeat service, so the file can be rotated.

As per the given suggestion we have used close\_removed and close\_renamed these two config in yml file, however, it still not working

> **[Frequently asked questions | Filebeat Reference \[7.1\] | Elastic](https://www.elastic.co/guide/en/beats/filebeat/7.1/faq.html)**

On Windows, you might have problems renaming or removing files because Filebeat keeps the file handlers open. This can lead to issues with the file rotating system. To avoid this issue, you can use the close\_removed and close\_renamed options together.

We are using filebeat 7.1 version

 ![Screenshot 2023-03-13 195315](https://us1.discourse-cdn.com/elastic/original/3X/d/0/d0eaf07ab5ffa6d49efc2a9bd05f1b6a4b6b315e.png)

 ![Screenshot 2023-03-13 195131](https://us1.discourse-cdn.com/elastic/original/3X/6/4/64e23f7dcbf91619454e2ebc7c8419884490cccd.png)

---

<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:** [April 10, 2023, 4:27pm UTC](https://discuss.elastic.co/t/issues-with-log-rotation-filebeat-lock-logs-file/327565/2 "2023-04-10T16:27:13Z")

</div>

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