Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify Kibana dashboard directory logic across Beats #7265

Merged
merged 1 commit into from
Jun 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG-developer.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The list below covers the major changes between 6.3.0 and master only.
- The beat.Pipeline is now passed to cfgfile.RunnerFactory. Beats using libbeat for module reloading or autodiscovery need to be adapted. {pull}7018[7017]
- Moving of TLS helper functions and structs from `output/tls` to `tlscommon`. {pull}7054[7054]
- Port fields.yml collector to Golang {pull}6911[6911]
- Dashboards under _meta/kibana are expected to be decoded. See https://github.com/elastic/beats/pull/7224 for a conversion script. {pull}7265[7265]

==== Bugfixes

Expand Down
1 change: 0 additions & 1 deletion auditbeat/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
build
_meta/kibana
_meta/beat.yml
_meta/beat.reference.yml
module/*/_meta/config.yml
Expand Down
8 changes: 3 additions & 5 deletions auditbeat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ collect-docs: python-env
# Collects all module dashboards
.PHONY: kibana
kibana:
@-rm -rf _meta/kibana
@mkdir -p _meta/kibana
@-cp -pr module/*/_meta/kibana _meta/
@# Convert all dashboards to string
@python ${ES_BEATS}/libbeat/scripts/unpack_dashboards.py --glob="./_meta/kibana/6/dashboard/*.json"
@-rm -rf _meta/kibana.generated
@mkdir -p _meta/kibana.generated
@-cp -pr module/*/_meta/kibana/* _meta/kibana.generated
2 changes: 1 addition & 1 deletion auditbeat/tests/system/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_dashboards(self):

dirs = [self.temp_dir("auditbeat_test")]
with PathCleanup(dirs):
kibana_dir = os.path.join(self.beat_path, "_meta", "kibana")
kibana_dir = os.path.join(self.beat_path, "_meta", "kibana.generated")
shutil.copytree(kibana_dir, os.path.join(self.working_dir, "kibana"))

es = Elasticsearch([self.get_elasticsearch_url()])
Expand Down
1 change: 0 additions & 1 deletion filebeat/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
filebeat

build
_meta/kibana
_meta/module.generated
_meta/beat.yml
_meta/beat.reference.yml
Expand Down
2 changes: 1 addition & 1 deletion filebeat/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MAINTAINER Nicolas Ruflin <ruflin@elastic.co>
RUN set -x && \
apt-get update && \
apt-get install -y --no-install-recommends \
netcat python-pip virtualenv && \
netcat python-pip rsync virtualenv && \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rsync added but not used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and now. It was used when make update was called inside the container. Now it happens outside again. The reason I would like to keep it in is that if someone wants to tests things from inside the container and run make update rsync will be needed for Filebeat.

apt-get clean

RUN pip install --upgrade setuptools
Expand Down
8 changes: 3 additions & 5 deletions filebeat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ before-build:
# Collects all module dashboards
.PHONY: kibana
kibana:
@rm -rf _meta/kibana
@mkdir -p _meta/kibana
@-cp -r module/*/_meta/kibana _meta/
@# Convert all dashboards to string
@python ${ES_BEATS}/libbeat/scripts/unpack_dashboards.py --glob="./_meta/kibana/6/dashboard/*.json"
@rm -rf _meta/kibana.generated
@mkdir -p _meta/kibana.generated
@-cp -pr module/*/_meta/kibana/* _meta/kibana.generated

# Collects all modules files to be packaged in a temporary folder
.PHONY: modules
Expand Down
2 changes: 1 addition & 1 deletion filebeat/tests/system/test_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def init(self):
"/../../../../module")

self.kibana_path = os.path.abspath(self.working_dir +
"/../../../../_meta/kibana")
"/../../../../_meta/kibana.generated")

self.filebeat = os.path.abspath(self.working_dir +
"/../../../../filebeat.test")
Expand Down
2 changes: 0 additions & 2 deletions heartbeat/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@

heartbeat

_meta/kibana

build
/tests/load/logs
8 changes: 3 additions & 5 deletions heartbeat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ create-monitor:
# Collects all module dashboards
.PHONY: kibana
kibana:
@rm -rf _meta/kibana
@mkdir -p _meta/kibana
@-cp -r monitors/active/*/_meta/kibana _meta/
@# Convert all dashboards to string
@python ${ES_BEATS}/libbeat/scripts/unpack_dashboards.py --glob="./_meta/kibana/6/dashboard/*.json"
@rm -rf _meta/kibana.generated
@mkdir -p _meta/kibana.generated
@-cp -r monitors/active/*/_meta/kibana/* _meta/kibana.generated
5 changes: 4 additions & 1 deletion libbeat/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,13 @@ endif
@mkdir -p docs
@${PYTHON_ENV}/bin/python ${ES_BEATS}/libbeat/scripts/generate_fields_docs.py $(PWD) ${BEAT_TITLE} ${ES_BEATS}

@mkdir -p $(PWD)/_meta/kibana.generated
@# Generate Kibana index pattern and copy dashboard files
if [ -d $(PWD)/_meta/kibana ]; then \
cp -r $(PWD)/_meta/kibana/ $(PWD)/_meta/kibana.generated; \
cp -pr $(PWD)/_meta/kibana/* $(PWD)/_meta/kibana.generated ; \
fi
@# Convert all dashboards to string
@python ${ES_BEATS}/libbeat/scripts/unpack_dashboards.py --glob="./_meta/kibana.generated/6/dashboard/*.json"
@mkdir -p $(PWD)/_meta/kibana.generated/5/index-pattern
@mkdir -p $(PWD)/_meta/kibana.generated/6/index-pattern
@go run ${ES_BEATS}/dev-tools/cmd/kibana_index_pattern/kibana_index_pattern.go -index '${BEAT_INDEX_PREFIX}-*' -beat-name ${BEAT_NAME} -beat-dir $(PWD) -version ${BEAT_VERSION}
Expand Down
1 change: 0 additions & 1 deletion metricbeat/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
build
_meta/kibana
_meta/beat.yml
_meta/beat.reference.yml

Expand Down
9 changes: 3 additions & 6 deletions metricbeat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ include ${ES_BEATS}/libbeat/scripts/Makefile
# Collects all module dashboards
.PHONY: kibana
kibana:
@rm -rf _meta/kibana
@mkdir -p _meta/kibana
@-cp -r module/*/_meta/kibana _meta/
@-cp -r module/*/_meta/kibana _meta/
@# Convert all dashboards to string
@python ${ES_BEATS}/libbeat/scripts/unpack_dashboards.py --glob="./_meta/kibana/6/dashboard/*.json"
@rm -rf _meta/kibana.generated
@mkdir -p _meta/kibana.generated
@-cp -pr module/*/_meta/kibana/* _meta/kibana.generated

# Collects all module docs
.PHONY: collect-docs
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/tests/system/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def test_dashboards(self):
Test that the dashboards can be loaded with `setup --dashboards`
"""

kibana_dir = os.path.join(self.beat_path, "_meta", "kibana")
kibana_dir = os.path.join(self.beat_path, "_meta", "kibana.generated")
shutil.copytree(kibana_dir, os.path.join(self.working_dir, "kibana"))

es = Elasticsearch([self.get_elasticsearch_url()])
Expand Down
1 change: 0 additions & 1 deletion packetbeat/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
_obj
_test
_output
_meta/kibana/*/index-pattern

# Architecture specific extensions/prefixes
*.[568vq]
Expand Down
1,134 changes: 938 additions & 196 deletions packetbeat/_meta/kibana/6/dashboard/Packetbeat-cassandra.json

Large diffs are not rendered by default.

Loading