当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
bash case usage
R语言使用ggpubr包的ggtexttable函数可视化表格数据(直接绘制表格图或者在图像中添加表格数据)、使用tab_add_vline函数自定义表格中竖线(垂直线)的线条类型以及线条粗细
Blazor Server(6) from scratch--policy-based permission verification
bash for循环
YOLOv5训练数据提示No labels found、with_suffix使用、yolov5训练时出现WARNING: Ignoring corrupted image and/or label
微信为什么使用 SQLite 保存聊天记录?
【倒计时5天】探索音画质量提升背后的秘密,千元大礼等你来拿
622. 设计循环队列
业界新标杆!阿里开源自研高并发编程核心笔记(2022最新版)
【HCIP持续更新】STP协议相关保护机制
进程内存
广州番禺:暑期防溺水,安全不放假
Feature Engineering Study Notes
4500字归纳总结,一名软件测试工程师需要掌握的技能大全
常用lambda表达式
第四课 标识符、关键字、变量、变量的分类和作用域、常量
Matlab学习11-图像处理之图像变换
零信任的基本概念【新航海】
Simple implementation of a high-performance clone of Redis using .NET (1)
4500 words sum up, a software test engineer need to master the skill books









