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
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?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.