当前位置:网站首页>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
边栏推荐
- pandas连接oracle数据库并拉取表中数据到dataframe中、筛选当前时间(sysdate)到一天之前的所有数据(筛选一天范围数据)
- 我在母胎SOLO20年
- __unaligned修饰指针
- Filebeat 如何保持文件状态?
- 【Verilog】HDLBits题解——Circuits/Sequential Logic/Latches and Flip-Flops
- 基于英雄联盟的知识图谱问答系统
- 最牛逼的集群监控系统,它始终位列第一!
- Take you understand the principle of CDN technology
- 数据库系统原理与应用教程(075)—— MySQL 练习题:操作题 151-159(十九):综合练习
- After completing the interview and clearance collection of Alibaba, I successfully won the 15th Offer this year
猜你喜欢
随机推荐
LeetCode-48. 旋转图像
mysql进阶(二十四)防御SQL注入的方法总结
FE主导打造一个运营活动平台
bash case用法
一个扛住 100 亿次请求的红包系统,写得太好了!!
R语言使用ggpubr包的ggtexttable函数可视化表格数据(直接绘制表格图或者在图像中添加表格数据)、使用tab_add_vline函数自定义表格中竖线(垂直线)的线条类型以及线条粗细
899. 有序队列
苹果发布 AI 生成模型 GAUDI,文字生成 3D 场景
通过点击CheckBox实现背景变换小案例
如何免费获得一个市全年的气象数据?降雨量气温湿度太阳辐射等等数据
3年软件测试经验,不懂自动化基础...不知道我这种测试人员是不是要被淘汰了?
特征工程学习笔记
[深入浅出]三位数排序
Matlab学习13-图像处理之可视化GUI程序
《数字经济全景白皮书》金融数字用户篇 重磅发布!
深度学习中数据到底要不要归一化?实测数据来说明!
【Verilog】HDLBits题解——Verification: Writing Testbenches
pytorch+tensorboard使用方法
第5章 实现首页Tab数据展示
当前页面的脚本发生错误如何解决_电脑出现当前页面脚本错误怎么办









