当前位置:网站首页>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
边栏推荐
- What knowledge points do you need to master to learn software testing?
- 谷歌研究员被群嘲:研究员爆料AI有意识,被勒令休假
- bash case用法
- asdn涨薪技术之apifox+Jenkins如何玩转接口自动化测试
- 什么是Weex
- Explain the virtual machine in detail!JD.com produced HotSpot VM source code analysis notes (with complete source code)
- bash case usage
- Filebeat 如何保持文件状态?
- Matlab学习12-图像处理之图像增强
- 【Verilog】HDLBits题解——Verification: Writing Testbenches
猜你喜欢
随机推荐
无监督学习KMeans学习笔记和实例
一次内存泄露排查小结
流式编程使用场景
R语言ggplot2可视化:使用patchwork包的plot_layout函数将多个可视化图像组合起来,ncol参数指定行的个数、byrow参数指定按照行顺序排布图
LeetCode-48. 旋转图像
899. 有序队列 : 最小表示法模板题
最牛逼的集群监控系统,它始终位列第一!
Feature dimensionality reduction study notes (pca and lda) (1)
基于英雄联盟的知识图谱问答系统
面试官:SOA 和微服务的区别?这回终于搞清楚了!
mysql advanced (twenty-four) method summary of defense against SQL injection
别再用if-else了,分享一下我使用“策略模式”的项目经验...
ThreadLocal源码解析及使用场景
After completing the interview and clearance collection of Alibaba, I successfully won the 15th Offer this year
数据库系统原理与应用教程(076)—— MySQL 练习题:操作题 160-167(二十):综合练习
Apache APISIX 2.15 版本发布,为插件增加更多灵活性
深入理解MySQL事务MVCC的核心概念以及底层原理
-树的高度-
word标尺有哪些作用
hystrix 服务熔断和服务降级









