2020-06-10—ELK之filebeat的配置与使用

ELK之filebeat的配置与使用

下载tar 文件,下载地址:https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.7.1-linux-x86_64.tar.gz

上传到Linux中后,利用命令解压。

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

一、解压完成后,进行配置:
配置filebeat.yml文件:

filebeat.inputs:
- type: log
enabled: true
paths:
# 此处为日志目录
- /var/log/*.log
#================ Kibana ============

setup.kibana:
host: "119.3.228.104:5601"

#-------------------------- Elasticsearch output --------
output.elasticsearch:
# Array of hosts to connect to.
hosts: ["119.3.228.104:9200"]

二、强制Kibana查看最新文件

curl -XDELETE 'http://localhost:9200/filebeat-*'
##手动加载模板(替代方法)
# 如果运行Filebeat的主机没有与Elasticsearch的直接连接,则可以将索引模板导出到文# 件中,将其移动到具有连接性的计算机上,然后手动安装该模板。
# 要导出索引模板,请运行:
./filebeat export template > filebeat.template.json

# To install the template, run:
curl -XPUT -H 'Content-Type: application/json' http://localhost:9200/_template/filebeat-7.7.1 -d@filebeat.template.json

# 设置kibana仪表盘
./filebeat setup --dashboards
# 启动运行
sudo chown root filebeat.yml
sudo ./filebeat -e

最后去你的Kibana主页,查看你的仪表盘:
image.png

发布于

2020-06-10

更新于

2022-03-25

许可协议

评论

:D 一言句子获取中...

加载中,最新评论有1分钟缓存...