A
u
Belaid Youba Hadj Arab, Etienne Deneuve
Nov 30, 2023 · 2 min read

Kibana backup system

Side view worker wearing gloves

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:

Terminal window
# 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

  1. Install Kibana-backup-simple locally using pip:

Terminal window
pip install kibana-backup-simple
  1. Then, execute the backup command with the correct URI and credentials:

Terminal window
kibana-backup.py backup --kibana-url <KIBANA_URL> --user <USER> --password <PASSWORD> > backup.json
  1. Note that with the above command, the backup only covers the default space. To backup all spaces, use :

Terminal window
kibana-backup.py backup --kibana-url <KIBANA_URL> --user <USER> --password <PASSWORD> --all-spaces --backup-file-prefix=backup-
  1. For restoration, it’s just as simple; replace backup with restore :

Terminal window
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!
Backup Kibana Tutorial

Related articles