ELK学习二:filebeat收集
【摘要】 下载安装地址:https://www.elastic.co/cn/downloads/beats/filebeat配置filebeatfilebeat配置分为2个部分,input和output:input:filebeat.inputs:# Each - is an input. Most options can be set at the input level, so# you can ...
下载安装地址:
https://www.elastic.co/cn/downloads/beats/filebeat
配置filebeat
filebeat配置分为2个部分,input和output:
input:
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:
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
./filebeat -e -c filebeat.yml -d "publish" # 直接启动查看启动日志
nohup ./filebeat -e -c filebeat.yml >/dev/null 2>&1 & # 后台方式启动
复制

【声明】本内容来自华为云开发者社区博主,不代表华为云及华为云开发者社区的观点和立场。转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息,否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)