qidao123.com ToB IT社区-企服评测·应用市场

 找回密码
 立即注册

摆设FileBeat收罗日志发送到Kafka集群服务器

[复制链接]
发表于 2025-11-14 22:09:47 | 显示全部楼层 |阅读模式
为什么要利用FileBeat

Logstash功能固然强大,但是他依靠java,在数据量大的时间,Logstash历程会斲丧过多的体系资源,这将严肃影响业务体系的性能,而Filebeat就是一个完善的代替者,filebeat是Beat成员之一,基于Go语言开辟,没有任何依靠,设置文件简单,格式明白,同时,Filebeat比Logstash更加轻量级以是占用体系资源少少,非常得当安装到生产呆板上。
FileBeat概述

Filebeat是用于转发和会合日志日志数据的轻量级发送器。Filebeat作为署理安装在您的服务器上,监视您指定的日志日志文件或位置,网络日志日志事故,并将它们转发到弹性搜刮大概Logstash用于索引。
Filebeat是如许工作的:当您启动Filebeat时,它会启动一个或多个输入,这些输入会在您为日志数据指定的位置中查找。对于Filebeat找到的每个日志,Filebeat都会启动一个收罗器。每个网络器读取一个新内容的日志,并将新的日志数据发送到libbeat,后者聚合事故并将聚合的数据发送到您为Filebeat设置的输出。


FileBeat安装

  1. #由于Filebeat基于Go语言开发,无其他依赖,因而安装非常简单,可以从elastic官网https://www.elastic.co/downloads/beats/filebeat/获取Filebeat的安装包
  2. #安装wget
  3. yum install wget
  4. #切换目录
  5. cd /usr/local/
  6. #下载Filebeat
  7. wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.13.4-linux-x86_64.tar.gz
  8. #解压缩   由于是下载的二进制Filebeat文件 解压即安装
  9. tar -xzvf filebeat-7.17.9-linux-x86_64.tar.gz -C /usr/local
  10. #更换名称
  11. mv filebeat-7.17.9-linux-x86_64 filebeat
  12. #到此安装完成
复制代码
简单先容FileBeat目次作用

  1. -rw-r--r--  1 root root        41 1月  31  2023 .build_hash.txt               
  2. -rw-r--r--  1 root root   3781373 1月  31  2023 fields.yml
  3. -rwxr-xr-x  1 root root 112216160 1月  31  2023 filebeat*                #可执行二进制文件
  4. -rw-r--r--  1 root root    170372 1月  31  2023 filebeat.reference.yml
  5. -rw-------  1 root root      8348 1月  31  2023 filebeat.yml                #配置文件
  6. drwxr-xr-x  3 root root      4096 1月  31  2023 kibana/        
  7. -rw-r--r--  1 root root     13675 1月  31  2023 LICENSE.txt
  8. drwxr-xr-x 76 root root      4096 1月  31  2023 module/         
  9. drwxr-xr-x  2 root root      4096 1月  31  2023 modules.d/             #模块文件 调用模块代码都在这个里面
  10. -rw-r--r--  1 root root   2058190 1月  31  2023 NOTICE.txt
  11. -rw-r--r--  1 root root       814 1月  31  2023 README.md
复制代码
设置filebeat.yml设置文件

  1. vim filebeat.yml
  2. #########filebeat.yml##########################
  3. ###################### Filebeat Configuration Example #########################
  4. # This file is an example configuration file highlighting only the most common
  5. # options. The filebeat.reference.yml file from the same directory contains all the
  6. # supported options with more comments. You can use it as a reference.
  7. #
  8. # You can find the full configuration reference here:
  9. # https://www.elastic.co/guide/en/beats/filebeat/index.html
  10. # For more available modules and options, please see the filebeat.reference.yml sample
  11. # configuration file.
  12. # ============================== Filebeat inputs ===============================
  13. filebeat.inputs:
  14. # Each - is an input. Most options can be set at the input level, so
  15. # you can use different inputs for various configurations.
  16. # Below are the input specific configurations.
  17. # filestream is an input for collecting log messages from files.
  18. #
  19. # hk-system
  20. - type: log
  21.   # Unique ID among all inputs, an ID is required.
  22.   id: hk-system-error
  23.   # Change to true to enable this input configuration.
  24.   enabled: true
  25.   # Paths that shoul
复制代码
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录

QQ|手机版|qidao123.com IT社区;IT企服评测▪应用市场 ( 浙ICP备20004199|浙ICP备20004199号 )|网站地图

GMT+8, 2026-4-17 07:16 , Processed in 0.248543 second(s), 31 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表