Kibana backup system
Elasticsearch & Kibana
Elasticsearch is a real-time distributed search engine and database. It allows for quick indexing and searching of large amounts of structured and unstructured data.
Kibana, on the other hand, is a data visualization and management interface for Elasticsearch. It enables exploration, visualization, and sharing of data stored in Elasticsearch through interactive dashboards and graphs.
- Together, Elasticsearch and Kibana form a comprehensive solution for data exploration, search, and analysis, widely used in various domains such as web search, real-time monitoring, data analysis, etc.
Kibana backup
The resources we often seek to save in Kibana are the dashboards, used to visualize datasets obtained via Elasticsearch
To export and import resources such as dashboards, we utilize the Kibana REST API. By making specific requests, we can obtain what we need:
cspell:disable >
# Example request $ curl -X POST api/saved_objects/_export -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' { "type": "index-pattern" }'For more information, refer to the documentation.
Kibana backup simple
- An tool designed to backup Kibana’s saved objects: configuration, index patterns, dashboards, saved searches, etc., in a straightforward manner (as the name suggests).
- For more information, check out the Github repository.
Method 1 : Local
Install
cspell:disable >Kibana-backup-simplelocally usingpip:
pip install kibana-backup-simpleThen, execute the backup command with the correct URI and credentials:
cspell:disable >
kibana-backup.py backup --kibana-url <KIBANA_URL> --user <USER> --password <PASSWORD> > backup.jsonNote that with the above command, the
cspell:disable >backuponly covers the default space. To backup all spaces, use :
kibana-backup.py backup --kibana-url <KIBANA_URL> --user <USER> --password <PASSWORD> --all-spaces --backup-file-prefix=backup-For restoration, it’s just as simple; replace
cspell:disable >backupwithrestore:
kibana-backup.py restore --kibana-url <KIBANA_URL> --user <USER> --password <PASSWORD> --all-spaces --backup-file-prefix=backup-Method 2 : Image Docker
- For this method, I’ll guide you through creating a neat Kibana backup system for AKS. This will involve a cron job that automatically performs backups, all stored in a storage account. Stay tuned for the next article!