十五、filebeat安装与配置

•filebeat安装与配置
–使用rpm 安装filebeat
rpm -ivhfilebeat-1.2.3-x86_64.rpm
–修改配置文件/etc/filebeat/filebeat.yml
–设置开机运行
[root@logstash] systemctlenable filebeat
–开启服务
[root@logstash] systemctlstart filebeat
配置filebeat 特别简单如下
[root@logstash ]# vim /etc/logstash/logstash.conf
input{
。。。。。。
beats{
port => 5044
}
。。。。。

然后部署客户端来到apache服务器,我们的Apache在kabana服务器上
[root@logstash patterns]# ssh 192.168.0.16
[root@kibana ~]# yum -y install filebeat-1.2.3-x86_64.rpm
[root@kibana ~]# vim /etc/filebeat/filebeat.yml
15 - /var/log/httpd/access_log
72 document_type: apachelog
183 # elasticsearch: 注释掉
188 # hosts: ["localhost:9200"] 注释掉
278 logstash:
280 hosts: ["182.168.0.18:5044"]
[root@kibana ~]# grep -Pv "^\s*(#|$)" /etc/filebeat/filebeat.yml
filebeat:
prospectors:
-
paths:
- /var/log/httpd/access_log
input_type: log
document_type: apachelog
registry_file: /var/lib/filebeat/registry
output:
logstash:
hosts: ["182.168.0.18:5044"]
shipper:
logging:
files:
rotateeverybytes: 10485760 # = 10MB
[root@kibana ~]# systemctl start filebeat.service
[root@kibana ~]# systemctl enable filebeat.service

posted @ 2021-08-23 10:05  落樰兂痕  阅读(436)  评论(0编辑  收藏  举报