当前位置:网站首页>How does Filebeat maintain file state?
How does Filebeat maintain file state?
2022-08-03 12:14:00 【Cloud Computing-Security】

Author: rab
1. Question
There is such a problem in actual testing/production. If the output target Kafka, ES, Kibana cannot be connected (accessed), how does Filebeat keep the file state?Is the file content successfully sent to the output?
2. Answer ️
The answer is yes, Filebeat will save the state of each file, it will flush the state in the registry file to disk, which records the harvester reads the last offset of the file, if output like Elasticsearch or Logstash is not accessible at this point, Filebeat keeps track of the last few lines sent, and continues reading the file when the output is available again, thus ensuring that all log lines are sent.
While Filebeat is running, state information for each input is also kept in memory.When Filebeat restarts, the data from the registry file is used to rebuild the state, and Filebeat continues each harvester at the last known location (ie, continues to collect the current latest data and output to the output destination).
That is, only Filebeat successfully sends the log content to the output destination (Kafka, ES, Kibana) from harvester until the output confirms that it has received the event, the next round of harvester will be opened.If you close Filebeat in the middle of sending events, it will not wait for the output to confirm that all events have been received before closing, any events sent to the output but not acknowledged before Filebeat shuts down, inThe is sent again when Filebeat restarts.This ensures that each event is sent at least once, but may end up sending duplicate events to the output.We can do this by setting shutdown_timeoutThe option configures Filebeat to wait a specific amount of time before shutting down.

For more questions, please refer to Official Documentation
边栏推荐
猜你喜欢
随机推荐
【必读要点】Pod控制器Deployment更新、回退详解
技术总监需要会些什么?也太难了!
(through page) ali time to upload the jar
一次内存泄露排查小结
-找树根-
用C语言解决A+B问题,A-B问题,A*B问题
利用ChangeStream实现Amazon DocumentDB表级别容灾复制
面试官:SOA 和微服务的区别?这回终于搞清楚了!
《数字经济全景白皮书》金融数字用户篇 重磅发布!
数据库系统原理与应用教程(075)—— MySQL 练习题:操作题 151-159(十九):综合练习
bash if条件判断
pandas连接oracle数据库并拉取表中数据到dataframe中、筛选当前时间(sysdate)到一天之前的所有数据(筛选一天范围数据)
为什么越来越多的开发者放弃使用Postman,而选择Eolink?
c语言进阶篇:内存函数
bash case usage
awk入门教程
Vs 快捷键---探索不一样的编程
AMS simulation
随机森林项目实战---气温预测
From scratch Blazor Server (6) - authentication based on strategy









