Skip to content

Commit

Permalink
Make packetbeat and filebeat better compatible with community beats (e…
Browse files Browse the repository at this point in the history
…lastic#3635)

Packetbeat and filebeat can be extended through protocols / modules. This requires both to be used as library if they are extended in their own beat. This is a first step to make it better compatible with this by adjusting import paths to depend on ES_BEATS.
  • Loading branch information
ruflin authored and tsg committed Feb 22, 2017
1 parent bae62de commit 4fa46d1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
5 changes: 3 additions & 2 deletions filebeat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

BEAT_NAME?=filebeat
BEAT_DESCRIPTION?=Filebeat sends log files to Logstash or directly to Elasticsearch.
SYSTEM_TESTS=true
SYSTEM_TESTS?=true
TEST_ENVIRONMENT?=true
GOX_FLAGS=-arch="amd64 386 arm ppc64 ppc64le"
ES_BEATS?=..

include ../libbeat/scripts/Makefile
include ${ES_BEATS}/libbeat/scripts/Makefile

# This is called by the beats packer before building starts
.PHONY: before-build
Expand Down
1 change: 1 addition & 0 deletions libbeat/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ update: python-env collect
$(MAKE) -C ${ES_BEATS}/libbeat fields

# Update docs
mkdir -p docs
. ${PYTHON_ENV}/bin/activate && python ${ES_BEATS}/libbeat/scripts/generate_fields_docs.py $(PWD) ${BEAT_NAME} ${ES_BEATS}

# Generate index templates
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Name can be overwritten, as Metricbeat is also a library
BEAT_NAME?=metricbeat
BEAT_DESCRIPTION?=Metricbeat sends metrics to Elasticsearch.
SYSTEM_TESTS=true
SYSTEM_TESTS?=true
TEST_ENVIRONMENT?=true
GOPACKAGES=$(shell go list ${BEAT_PATH}/... | grep -v /vendor/)
ES_BEATS?=..
Expand Down
13 changes: 8 additions & 5 deletions packetbeat/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@

BEAT_NAME?=packetbeat
BEAT_DESCRIPTION?=Packetbeat analyzes network traffic and sends the data to Elasticsearch.
SYSTEM_TESTS=true
SYSTEM_TESTS?=true
TEST_ENVIRONMENT=false
TARGETS="windows/amd64 windows/386 darwin/amd64"
TARGETS_OLD="linux/amd64 linux/386"
CGO=true
ES_BEATS?=..

include ../libbeat/scripts/Makefile
include ${ES_BEATS}/libbeat/scripts/Makefile

.PHONY: with_pfring
with_pfring:
Expand All @@ -32,19 +33,21 @@ collect: fields imports

.PHONY: fields
fields:
cat _meta/fields_base.yml > _meta/fields.yml
cat protos/*/_meta/fields.yml >> _meta/fields.yml
mkdir -p _meta
cat ${ES_BEATS}/packetbeat/_meta/fields_base.yml > _meta/fields.yml
-cat protos/*/_meta/fields.yml >> _meta/fields.yml

.PHONY: benchmark
benchmark:
go test -short -bench=. ./... -cpu=2

.PHONY: create-tcp-protocol
create-tcp-protocol:
python scripts/create_tcp_protocol.py
python ${ES_BEATS}/packetbeat/scripts/create_tcp_protocol.py

# Generates imports for all modules and metricsets
.PHONY: imports
imports:
mkdir -p include
mkdir -p protos
python ${ES_BEATS}/packetbeat/scripts/generate_imports.py ${BEAT_PATH} > include/list.go

0 comments on commit 4fa46d1

Please sign in to comment.