Logstash 基础5

2022-02-10 20:32:26 浏览数 (1)

Filebeat

Filebeat 是一个轻量友好的工具,用来从目标服务器中收集文本日志然后然后转发给 Logstash 实例进行处理,其实就是一个 Logstash 的轻量前端文本收集代理

The filebeat client is a lightweight, resource-friendly tool that collects logs from files on the server and forwards these logs to your Logstash instance for processing

配置和启动filebeat

代码语言:javascript复制
[root@h102 etc]# grep -v "#" /etc/filebeat/filebeat.yml  | grep -v "^$"
filebeat:
  prospectors:
    -
      paths:
        - /var/log/*.log
        - /var/log/messages*
      input_type: log
  registry_file: /var/lib/filebeat/registry
output:
  logstash:
    hosts: ["localhost:5044"]
shipper:
logging:
  files:
[root@h102 etc]# /etc/init.d/filebeat start 
Starting filebeat:                                         [  OK  ]
[root@h102 etc]# /etc/init.d/filebeat status
filebeat-god (pid  2770) is running...
[root@h102 etc]# ps faux | grep filebeat
root      2787  0.0  0.0 103256   828 pts/1    S    15:53   0:00          _ grep filebeat
root      2770  0.0  0.0  11388   232 pts/1    Sl   15:52   0:00 filebeat-god -r / -n -p /var/run/filebeat.pid -- /usr/bin/filebeat -c /etc/filebeat/filebeat.yml
root      2771  0.5  0.7 356380 13944 pts/1    Sl   15:52   0:00  _ /usr/bin/filebeat -c /etc/filebeat/filebeat.yml
[root@h102 etc]# 

0 人点赞