Filebeat采集⽂本⽂件内容发送到kafka 1. 安装filebeat,选择tar包安装⽅式,下载并解压
bak文件wget /downloads/beats/filebeat/filebeat-7.7.0-linux-x86_
tar -zxvf filebeat-7.7.0-linux-x86_
2. 修改配置⽂件
l.bak
l
配置⽂件内容
logging.level: info
<_files: true
logging.files:
path: /data/log_path/filebeat
name: filebeat
keepfiles: 7
permissions: 0644
filebeat.inputs:
- type: log
enabled: true
paths:
- /your_file_name
scan_frequency: 1s
backoff: 1s
max_backoff: 1s
ignore_older: 24h
close_inactive: 30m
close_timeout: 24h
clean_inactive: 720h
encoding: utf-8
output.kafka:
version: "2.0.0"
enabled: true
hosts: your_kafka_ip:tour_kafka_port
topic: your_kafka_topic # topic name
username: xxxxxx # kafka username
password: xxxxxx # kafka password
required_acks: 1
compression: gzip
max_message_bytes: 1000000
codec.format:
string: '%{[message]}'
3. 启动脚本
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论