Simple backup for Kibana saved objects: config, index patterns, dashboards, saved searches, etc.
Uses python3 and python-requests library, which you have to install on your every host anyway, because it's awesome.
kibana-backup.py [--kibana-url KIBANA_URL] [--user USER] [--password PASSWORD] backup > backup.ndjson
cat backup.ndjson | kibana-backup.py [--kibana-url KIBANA_URL] [--user USER] [--password PASSWORD] restore
backupwrite backup file in newline-delimitered json format to stdoutrestorerestore backup from stdin--kibana-urlbase URL to access Kibana API, default:http://127.0.0.1:5601--space-idKibana space id. If not set then the default space is used.--userKibana user--passwordKibana password
Note: To use the default space you should not set --space-id parameter. Setting it to the default space id: default does not work.
- https://www.elastic.co/guide/en/kibana/current/saved-objects-api-export.html
- https://www.elastic.co/guide/en/kibana/current/saved-objects-api-import.html
P.S. If this code is useful for you - don't forget to put a star on it's github repo.