Beats开发指南
原文链接: Beats开发指南
创建beat项目
python $GOPATH/src/github.com/elastic/beats/script/generate.py
安装环境依赖
cd ${GOPATH}/src/github.com/{user}/mybeatmake setup
编译 运行
make
./countbeat -e -d "*"
导入 dashboards
./scripts/import_dashboards -dir kibana/metricbeat
`./scripts/import_dashboards -file metricbeat-dashboards-1.1.zip`
`./scripts/import_dashboards -url https://artifacts.elastic.co/downloads/beats/beats-dashboards/beats-dashboards-5.4.1.zip`
./scripts/import_dashboards -es http://120.92.36.21:9200 -user elastic -pass changeme
`beats/libbeat/dashboards/import_dashboards -beat metricbeat`
index_pattern ./scripts/import_dashboards -only-index
dashboards ./scripts/import_dashboards -only-dashboards
docker run --rm -it docker.elastic.co/beats/heartbeat:5.4.0 /usr/share/heartbeat/scripts/import_dashboards -beat "heartbeat" -file /usr/share/heartbeat/beats-dashboards-5.4.0.zip -es http://139.129.234.31:9200 -user elastic -pass changeme
- 根据
_meta/fields.yml
生成index_pattern
make update
根据 fields.yaml 导入elastic template
output.elasticsearch:
hosts: ["localhost:9200"]
template.name: "metricbeat"
template.fields: "fields.yml"
template.overwrite: false
导出
ES_URL="http://192.168.3.206:9200" make export-dashboards打包 dashboards
make package-dashboards