ELK系列教程-安装filebeat(四)

46次阅读
没有评论

一、简介

本文介绍了如何快速开始收集日志。您将学习如何:

  • 在要监视的每个系统上安装Filebeat
  • 指定日志文件的位置
  • 将日志数据解析为字段并将其发送到Elasticsearch
  • 可视化Kibana中的日志数据

二、开始安装

  1. 导入秘钥

    #rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
  2. 创建elastic.repo文件

    #vim /etc/yum.repos.d/elastic.repo
    [elastic-7.x]
    name=Elastic repository for 7.x packages
    baseurl=https://artifacts.elastic.co/packages/7.x/yum
    gpgcheck=1
    gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
    enabled=1
    autorefresh=1
    type=rpm-md
  3. yum安装

    #yum install -y filebeat

    2.1 配置filebeat

    需要连接到Elasticsearch和Kibana来设置Filebeat。在中设置连接信息filebeat.yml
    #vim /etc/filebeat/filebeat.yml

    filebeat.inputs:
    - type: log
    paths:
    - /var/log/logstash.log
    output.logstash:
    hosts: ["192.168.152.11:5044"]

2.2 启动服务

#/usr/share/filebeat/bin/filebeat -e -c /etc/filebeat/filebeat.yml -d "publish"

ELK系列教程-安装filebeat(四)

正文完
 
oakcdrom
版权声明:本站原创文章,由 oakcdrom 2021-02-03发表,共计728字。
转载说明:转载请注明出处。
评论(没有评论)