当前位置:网站首页>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
边栏推荐
- 超多精美礼品等你来拿!2022年中国混沌工程调查启动
- 什么是bin文件?「建议收藏」
- Explain the virtual machine in detail!JD.com produced HotSpot VM source code analysis notes (with complete source code)
- 类型转换、常用运算符
- 码率vs.分辨率,哪一个更重要?
- 字节最爱问的智力题,你会几道?
- B站回应“HR 称核心用户都是 Loser”:该面试官去年底已被劝退,会吸取教训加强管理
- mysql advanced (twenty-four) method summary of defense against SQL injection
- 广州番禺:暑期防溺水,安全不放假
- 通过点击CheckBox实现背景变换小案例
猜你喜欢
随机推荐
第4章 搭建网络库&Room缓存框架
后台图库上传功能
用C语言解决A+B问题,A-B问题,A*B问题
《数字经济全景白皮书》金融数字用户篇 重磅发布!
字节最爱问的智力题,你会几道?
LeetCode刷题笔记:622.设计循环队列
fastposter v2.9.0 程序员必备海报生成器
B站回应“HR 称核心用户都是 Loser”:该面试官去年底已被劝退,会吸取教训加强管理
Feature dimensionality reduction study notes (pca and lda) (1)
一次内存泄露排查小结
流式编程使用场景
想学自动化测试网课哪个好?过了人告诉你:适合自己的才是最重要
bash case usage
-找树根2-
面试突击71:GET 和 POST 有什么区别?
YOLOv5训练数据提示No labels found、with_suffix使用、yolov5训练时出现WARNING: Ignoring corrupted image and/or label
微信为什么使用 SQLite 保存聊天记录?
fastposter v2.9.0 programmer must-have poster generator
pandas连接oracle数据库并拉取表中数据到dataframe中、生成当前时间的时间戳数据、格式化为指定的格式(“%Y-%m-%d-%H-%M-%S“)并添加到csv文件名称中
bash if条件判断