This code was tested using:
- ElasticSearch 5.4.0
- Kibana 5.1.1-SNAPSHOT
Code is compatible with Python 3, older versions are not supported.
We are going to use Chrome Headless mode, so version >=59 of Chrome web browser is needed.
Chromedriver is also needed, you can download latest version from: https://sites.google.com/a/chromium.org/chromedriver/home
You'll get a zip file containing a binary called chromedriver
. Just extract
it and move it to your PATH. If you are using a Python virtual environment,
you can move it to your venv/bin
path. To check your setup execute:
(venv) ➜ snapdash git:(master) ✗ chromedriver
Starting ChromeDriver 2.40.565383 (76257d1ab79276b2d53ee976b2c3e3b9f335cde7) on port 9515
Only local connections are allowed.
Get a file with a dashboard snapshot.
snapdash <url> <image_name> [--start-date <date> --end-date <date>]
url
: dashboard URL.image_name
: desired output image name (path without file extension).--start-date
: date to retrieve data from. If not specified, dashboard default time frame will be used.--end-date
: date to retrieve data to. Defaults to now and has no effect if--start-date
is not specified.
- Access to Kibana non-editable version.
Get a file with a single visualization given its URL, e.g.:
http://localhost:5601/app/kibana#/visualize/edit/discourse_categories
snapdash <url> <image_name> [--start-date <date> --end-date <date>]
Arguments are the same as in UC 1: Dashboard Snapshot.
snapdash
should capture only visualization canvas.
- Access to Kibana editable version.
Get a file with a specified visualization from a Dashboard.
snapdash <url> <image_name> --viz <viz_id> [--start-date <date> --end-date <date>]
url
: dashboard URL.image_name
: desired output image name (path without file extension).--viz
: identifier of the visualization we want to get a snapshot from.--start-date
: date to retrieve data from. If not specified, dashboard default time frame will be used.--end-date
: date to retrieve data to. Defaults to now and has no effect if--start-date
is not specified.
- Access to Kibana non-editable version.
Get a file for each visualization in a Dashboard.
snapdash <url> <image_name> --crop-viz [--start-date <date> --end-date <date>]
url
: dashboard URL.image_name
: desired output image name (path without file extension).--crop-viz
: get separate snapshots for each and every viz in dashboard.--start-date
: date to retrieve data from. If not specified, dashboard default time frame will be used.--end-date
: date to retrieve data to. Defaults to now and has no effect if--start-date
is not specified.
- Access to Kibana non-editable version.