filebeat跟logstash搭建指南

一:  filebeat安装

1.下载解压filebeat

curl -L -Ohttps://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.0.0-linux-x86_64.tar.gz

tar xzvf filebeat-8.0.0-linux-x86_64.tar.gz


2.修改配置文件

cd filebeat-8.0.0-linux-x86_64/

2.1配置日志文件地址


2.2输出kafka


3.启动filebeat

nohup ./filebeat -e -c filebeat-kafka.yml> filebeat.log &

tar解压的不能用上面方式启动,关闭窗口会停止服务,需要设置系统服务

4.设置filebeat为系统服务

1. vim/lib/systemd/system/filebeat.service

    2.

[Unit]

Description=filebeat

Wants=network-online.target

After=network-online.target


[Service]

User=dev

ExecStart=/data/soft/filebeat-8.0.0-linux-x86_64/filebeat-e -c /data/soft/filebeat-8.0.0-linux-x86_64/filebeat-kafka.yml

Restart=always


[Install]

WantedBy=multi-user.target

3. systemctlstart filebeat


二: logstash安装

1.下载解压

https://www.elastic.co/cn/downloads/logstash


tar xzvf logstash-8.0.0-linux-x86_64.tar.gz


2.修改配置文件

cd logstash-8.0.0/

2.1 配置kafka接收topic

2.2 配置过滤规则


2.3 配置kafka输出topic

3.启动logstash

nohup bin/logstash -fconfig/logstash-kafka.conf --config.reload.automatic > logstash.log &

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容