下载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

 

最新文章

  1. leetcode--5. Longest Palindromic Substring
  2. NHibernate使用Access数据库的配置问题
  3. maven出现 -Dmaven.multiModuleProjectDirectory system propery错误
  4. html+css 技巧
  5. 剑指Offer 顺时针打印矩阵
  6. hosts代理
  7. 解析表达式到lucene.net的Query
  8. Python之urllib2
  9. kvm中运行kvm
  10. finally块执行时间
  11. MSSQL TABLE COPY TABLE
  12. “帮你”APP——NABCD需求分析
  13. c++学习之字符串拼接
  14. 可上下拖动且有浮沉动画的View
  15. Linux Compile Multiple C++ Files
  16. 20155320 Exp3 免杀原理与实践
  17. Statistical Concepts and Market Returns
  18. js_跑马灯
  19. free函数在操作系统内存中的实现【转】
  20. org.apache.http.NoHttpResponseException: XX.XX.XX.XX:80 failed to respond

热门文章

  1. 餐饮ERP相关问题FAQ
  2. redis sentinel集群的搭建
  3. jar、war、ear
  4. 后台调用前端JS
  5. Linux下安装JDK,Tomcat,Mysql详细教程
  6. 暂别SQL Server,转战MySQL和Redis
  7. 讲解wpe抓包,封包
  8. (转载)关于usr/bin/ld: cannot find -lxxx问题总结
  9. window中常用的命令
  10. Python取整函数