zoukankan      html  css  js  c++  java
  • filebeat 源码编译安装

    下载filebeat源码(6.2.3)下载地址:链接: https://pan.baidu.com/s/1cPR7-xlQJuYZ77uaUpfSpQ 提取码: k77u

    github下载地址:https://github.com/elastic/beats

    github下载过程如下图所示

    编译步骤,见官网文档,查找如下图所示:

    在docs目录下有devguide目录,在该目录下有个contributing.asciidoc文档

    文档中Setting Up Your Dev Environment章节

    内容:

    The Beats are Go programs, so install the latest version of golang if you don’t have it already. The current Go version used for development is Golang {go-version}.

    The location where you clone is important. Please clone under the source directory of your GOPATH. If you don’t have GOPATHalready set, you can simply set it to the go directory in your home (export GOPATH=$HOME/go).

    mkdir -p ${GOPATH}/src/github.com/elastic
    cd ${GOPATH}/src/github.com/elastic
    git clone https://github.com/elastic/beats.git
    Note
    If you have multiple go paths, use ${GOPATH%%:*} instead of ${GOPATH}.

    可以看出,filebeat编译,需要go语言环境,6.2.3用的go语言是1.9.2,其按照步骤参考:https://www.cnblogs.com/dyh004/p/9669406.html

    Then you can compile a particular Beat by using the Makefile. For example, for Packetbeat:(文档中,以packetbeat为例进行编译),我们要编译的是filebeat

    cd beats/filetbeat
    make

    make之后,会在filebeat目录下生产filebeat可执行文件,如图

    编译配置filebeat.yml文件

    1.将enable 设置为true
    2.paths设置指定的log文件的输出目录
    3.添加fields字段,通过ip添加索引名称,名称设置为自己的姓名加ip地址便于区分,索引名称不能包括大写。

    4.将oupput模块的配置elastic output,或者logstash

      5.filebeat启动:

    ./filebeat -e -c filebeat.yml -d "Publish"

    -e: Log to stderr and disable syslog/file output

    -c: Configuration file, relative to path.config (default "filebeat.yml")

    -d: Enable certain debug selectors

     
  • 相关阅读:
    单点登录
    企业SOA架构案例分析
    京东峰值系统设计
    阿里搜索离线大数据平台架构
    国内不FQ使用ARCore
    Unity Android上视频使用Seek方法跳转有误差
    《搬砖日记》Obi Rope插件的简单使用
    《搬砖日记》AssetsBundle实现资源更新及通过反射添加脚本
    入园一周年
    《搬砖日记》Unity原生MicroPhone的使用
  • 原文地址:https://www.cnblogs.com/dyh004/p/9673615.html
Copyright © 2011-2022 走看看