首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >ELK学习二:filebeat收集

ELK学习二:filebeat收集

作者头像
仙士可
发布2022-06-14 15:11:09
发布2022-06-14 15:11:09
31600
代码可运行
举报
文章被收录于专栏:仙士可博客仙士可博客
运行总次数:0
代码可运行

下载安装地址:

https://www.elastic.co/cn/downloads/beats/filebeat

配置filebeat

filebeat配置分为2个部分,input和output:

input:

代码语言:javascript
代码运行次数:0
运行
复制
filebeat.inputs:

# Each - is an input. Most options can be set at the input level, so
# you can use different inputs for various configurations.
# Below are the input specific configurations.

- type: log

  # Change to true to enable this input configuration.
  enabled: true

  # Paths that should be crawled and fetched. Glob based paths.
  paths:
    - /var/log/*.log
    - /www/wwwlogs/**

output:

代码语言:javascript
代码运行次数:0
运行
复制
output.kafka:
  hosts: ["127.0.0.1:9092"]

  # 在这里通过引用fields来指定目标topic
  topic: 'test-input'
  version: 0.11.0.0
  compression: gzip
  max_message_bytes: 1000000

注意,开启kafka output需要在modules.d/中将kafka.yml.disable改名为 kafka.yml

启动filebeat 

代码语言:javascript
代码运行次数:0
运行
复制
./filebeat -e -c filebeat.yml -d "publish"    # 直接启动查看启动日志
nohup ./filebeat -e -c filebeat.yml >/dev/null 2>&1 &  # 后台方式启动

本文为仙士可原创文章,转载无需和我联系,但请注明来自仙士可博客www.php20.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022/06/13 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 配置filebeat
  • 启动filebeat 
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档