当前位置:网站首页>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_timeout
The option configures Filebeat to wait a specific amount of time before shutting down.
For more questions, please refer to Official Documentation
边栏推荐
猜你喜欢
4500 words sum up, a software test engineer need to master the skill books
YOLOv5训练数据提示No labels found、with_suffix使用、yolov5训练时出现WARNING: Ignoring corrupted image and/or label
C language advanced article: memory function
类型转换、常用运算符
分享一款实用的太阳能充电电路(室内光照可用)
Filebeat 如何保持文件状态?
Explain the virtual machine in detail!JD.com produced HotSpot VM source code analysis notes (with complete source code)
nacos应用
Matlab学习12-图像处理之图像增强
5个超好用手机开源自动化工具,哪个适合你?
随机推荐
子结点的数量
第十五章 源代码文件 REST API 简介
LeetCode-142. 环形链表 II
从零开始Blazor Server(6)--基于策略的权限验证
bash for循环
Apache APISIX 2.15 版本发布,为插件增加更多灵活性
net start mysql 启动报错:发生系统错误5。拒绝访问。
setTimeout 、setInterval、requestAnimationFrame
【Verilog】HDLBits题解——验证:阅读模拟
AMS simulation
R语言绘制时间序列的自相关函数图:使用acf函数可视化时间序列数据的自相关系数图
fastposter v2.9.0 programmer must-have poster generator
YOLOv5训练数据提示No labels found、with_suffix使用、yolov5训练时出现WARNING: Ignoring corrupted image and/or label
After completing the interview and clearance collection of Alibaba, I successfully won the 15th Offer this year
Mysql重启后innodb和myisam插入的主键id变化总结
零信任的基本概念【新航海】
From scratch Blazor Server (6) - authentication based on strategy
Five super handy phone open-source automation tools, which is suitable for you?
622. 设计循环队列
Simple implementation of a high-performance clone of Redis using .NET (1)