filebeat
Filebeat is a log file shipping tool After installing the client on your server, filebeat monitors log directory or specified log files that track read (change tracking file, keep reading), and forward them logstarsh information to elasticsearch or stored.
filebeat can collect local files, and can be exported to redis, console, file, kafka, etc.
-------------------------------------------------- ------------------------ ------------------------- combat -------------------------------------------------- -
1.filebeat to a local file into Redis
filebeat.inputs:
- of the type: log
Enabled: to true
Paths:
- /usr/local/soft/elk/install/logstash-7.1.0/config/demo/1.log
output.redis:
hosts: [ "localhost: 6379"]
password: "[email protected]"
Key: "myredis"
2.filebeat local file in to the console
filebeat.inputs:
- of the type: log
Enabled: to true
Paths :
- /usr/local/soft/elk/install/logstash-7.1.0/config/demo/1.log
output.console:
Pretty: to true
3.filebeat to a local file in the file
filebeat.inputs:
- of the type: log
Enabled: to true
Paths:
- /usr/local/soft/elk/install/logstash-7.1.0/config/ demo / 1.log
output.file:
path: "/tmp/filebeat"
filename: filebeat
#rotate_every_kb: 10000
#number_of_files: 7
#permissions: 0600
4.filebeat将本地文件放入到kafka
filebeat.inputs:
- type: log
enabled: true
paths:
- /usr/local/soft/elk/install/logstash-7.1.0/config/demo/1.log
output.kafka:
enable: true
hosts: ["47.107.146.57:9092"]
topic: 'test'
#version: '0.10.2.0'