Hello,
Can filebeat lock some monitored files for some reasons (Windows Server 2008 R2)?
Regards,
Ovidiu
Hello,
Can filebeat lock some monitored files for some reasons (Windows Server 2008 R2)?
Regards,
Ovidiu
Filebeat keeps the files it is reading open. That is probably what you mean by locked. If that is an issue, see force_close_files config: https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-configuration-details.html#_force_close_files But please read the docs as this can have side affects.
Hello,
Thank you for your answer. I think I fix this issue.
The problem was something like that:
It was my mistake
Have a nice day!
Ovidiu
Glad you found a solution.
Hi @djvidov could you please tell me how did you fix the issue? I face similar issue in Windows 2012 R8 server. I use log4j for writing logs. did you change anything in log4Net settings or Filebeat?
Thanks in advance!
Hello @Sujoy_Acharya,
Sorry for that late answer.
in extended class of RollingFileAppender I've add an try catch in order to avoid crash of log4net like in code shown bellow:
public class DateRollingFileAppender : RollingFileAppender {
//your code here
public override void ActivateOptions() {
//your code here
if(your delete condition)
try
{
System.IO.File.Delete(files[i]);
}
catch (Exception ex)
{
//manage it
}
}
}
I hope this will help you.
Regards,
Ovidiu
© 2020. All Rights Reserved - Elasticsearch
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.