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