当前位置:网站首页>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
边栏推荐
- 第4章 搭建网络库&Room缓存框架
- Chapter 15 Source Code File REST API Introduction
- 无监督学习KMeans学习笔记和实例
- [Verilog] HDLBits Problem Solution - Verification: Writing Testbenches
- 622. 设计循环队列
- net start mysql 启动报错:发生系统错误5。拒绝访问。
- [论文阅读] (23)恶意代码作者溯源(去匿名化)经典论文阅读:二进制和源代码对比
- flink流批一体有啥条件,数据源是从mysql批量分片读取,为啥设置成批量模式就不行
- 【精品必知】Pod生命周期
- 通过点击CheckBox实现背景变换小案例
猜你喜欢

setTimeout 、setInterval、requestAnimationFrame

Matlab学习12-图像处理之图像增强

特征降维学习笔记(pca和lda)(1)

苹果发布 AI 生成模型 GAUDI,文字生成 3D 场景

Filebeat 如何保持文件状态?

After completing the interview and clearance collection of Alibaba, I successfully won the 15th Offer this year

第4章 搭建网络库&Room缓存框架

hystrix 服务熔断和服务降级

《数字经济全景白皮书》金融数字用户篇 重磅发布!

5个超好用手机开源自动化工具,哪个适合你?
随机推荐
mysql进阶(二十四)防御SQL注入的方法总结
Matlab学习12-图像处理之图像增强
pandas连接oracle数据库并拉取表中数据到dataframe中、筛选当前时间(sysdate)到一天之前的所有数据(筛选一天范围数据)
[深入浅出]三位数排序
net start mysql 启动报错:发生系统错误5。拒绝访问。
LyScript 实现对内存堆栈扫描
QGIS绘制演习区域示意图
利用ChangeStream实现Amazon DocumentDB表级别容灾复制
R语言ggplot2可视化:使用patchwork包的plot_layout函数将多个可视化图像组合起来,ncol参数指定行的个数、byrow参数指定按照行顺序排布图
漫谈缺陷管理的自动化实践方案
R language ggplot2 visualization: use the patchwork bag plot_layout function will be more visual image together, ncol parameter specifies the number of rows, specify byrow parameters configuration dia
【云原生 · Kubernetes】部署Kubernetes集群
超多精美礼品等你来拿!2022年中国混沌工程调查启动
Apache APISIX 2.15 版本发布,为插件增加更多灵活性
别再用if-else了,分享一下我使用“策略模式”的项目经验...
【必读要点】Pod控制器Deployment更新、回退详解
(through page) ali time to upload the jar
使用.NET简单实现一个Redis的高性能克隆版(一)
php microtime encapsulates the tool class, calculates the running time of the interface (breakpoint)
c语言进阶篇:内存函数