# Disable automatic rotation Filebeat

**URL:** https://discuss.elastic.co/t/disable-automatic-rotation-filebeat/63972
**Category:** Beats
**Tags:** filebeat
**Created:** [October 26, 2016, 8:27am UTC](https://discuss.elastic.co/t/disable-automatic-rotation-filebeat/63972 "2016-10-26T08:27:11Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Clement\_Ros](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clement_ros/32/6198_2.png) [@Clement\_Ros](https://discuss.elastic.co/u/Clement_Ros)
#### Post date: [October 26, 2016, 8:27am UTC](https://discuss.elastic.co/t/disable-automatic-rotation-filebeat/63972/1 "2016-10-26T08:27:11Z")

</div>

Hi,

I use logrotate to rotate le log, and i wanted to know how can i disable the automatic rotation of Filebeat ?  
I already try to change the rotateeverybytes parameters :

```
# Configure log file size limit. If limit is reached, log file will be
# automatically rotated
#rotateeverybytes: 10485760 # = 10MB
rotateeverybytes: 4294967296000 # = 500Go

```

But this not seems to work :

```
-rw-r--r-- 1 root root 8477287 Oct 26 10:25 filebeat.log
-rw-r--r-- 1 root root 0 Oct 26 00:01 filebeat.log.1
-rw-r--r-- 1 root root 936 Oct 25 15:15 filebeat.log.2
-rw-r--r-- 1 root root 936 Oct 25 15:47 filebeat.log-20161025
-rw-r--r-- 1 root root 51881520 Oct 26 00:01 filebeat.log.3
-rw-r--r-- 1 root root 201439926 Oct 25 14:57 filebeat.log.4
-rw-r--r-- 1 root root 0 Oct 25 00:01 filebeat.log.5
-rw-r--r-- 1 root root 0 Oct 24 00:00 filebeat.log.6

```

Thanks

---

<div class="post-metadata">

### Author: ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)
#### Post date: [October 26, 2016, 8:26pm UTC](https://discuss.elastic.co/t/disable-automatic-rotation-filebeat/63972/2 "2016-10-26T20:26:34Z")

</div>

This is currently not possible. Best follow [https://github.com/elastic/beats/issues/2764](https://github.com/elastic/beats/issues/2764) for more details.

---

<div class="post-metadata">

### Author: ![Clement\_Ros](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clement_ros/32/6198_2.png) [@Clement\_Ros](https://discuss.elastic.co/u/Clement_Ros)
#### Post date: [October 28, 2016, 9:23am UTC](https://discuss.elastic.co/t/disable-automatic-rotation-filebeat/63972/3 "2016-10-28T09:23:56Z")

</div>

Thanks for the information.

So the only way to do this is to set a high value to the "rotateeverybytes".

In my configuration i had put the value to 500Go and my log file did rotate before reaching 500Go.  
What is the reason ?

---

<div class="post-metadata">

### Author: ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)
#### Post date: [October 28, 2016, 2:49pm UTC](https://discuss.elastic.co/t/disable-automatic-rotation-filebeat/63972/4 "2016-10-28T14:49:23Z")

</div>

It gets rotated every time on restart. Could that be the reason? Or does it get rotated during running?

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [October 30, 2016, 2:51pm UTC](https://discuss.elastic.co/t/disable-automatic-rotation-filebeat/63972/5 "2016-10-30T14:51:02Z")

</div>

The thing is, logrotate needs to tell the application it is about to rotate a log file. normally this is done by sending a signal (e.g. SIGHUB) to the process (which is not supported by go runtime for platform compatibility). Without logrotate telling the process the files has changed (e.g. forcing restart), the process will continue writing into the old file. If copy is used in logrotate or file is compressed from original log as is, logs might get missing as well.

I guess you're setting 500gb log file in filebeat + copytruncate in logrotate?

---

<div class="post-metadata">

### Author: ![Clement\_Ros](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clement_ros/32/6198_2.png) [@Clement\_Ros](https://discuss.elastic.co/u/Clement_Ros)
#### Post date: [November 2, 2016, 8:47am UTC](https://discuss.elastic.co/t/disable-automatic-rotation-filebeat/63972/6 "2016-11-02T08:47:18Z")

</div>

Hi,

Filebeat rotate the log file every time on restart. Can i disable that ?

---

<div class="post-metadata">

### Author: ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)
#### Post date: [November 2, 2016, 9:48am UTC](https://discuss.elastic.co/t/disable-automatic-rotation-filebeat/63972/7 "2016-11-02T09:48:30Z")

</div>

This is currently not possible. It's probably worth to also add this to [https://github.com/elastic/beats/issues/2764](https://github.com/elastic/beats/issues/2764)

---

<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: [November 16, 2016, 8:27am UTC](https://discuss.elastic.co/t/disable-automatic-rotation-filebeat/63972/8 "2016-11-16T08:27:34Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
