Skip to content

Instantly share code, notes, and snippets.

@omerh
Last active August 12, 2019 10:51
Show Gist options
  • Save omerh/e79099f3825225434f162a167a0ddeff to your computer and use it in GitHub Desktop.
Save omerh/e79099f3825225434f162a167a0ddeff to your computer and use it in GitHub Desktop.
Restore and rename aws elasticsearch kibana from snapshot

get repositories name

curl -XGET 'https://<domain-end-point>/_snapshot/_all

list snapshots from the repository

curl -XGET 'https://<domain-end-point>/_snapshot/<repository-name>/_all

Select a snapshot from the reposiztory to restore kibna index

restore kibana index with renaming it

curl -XPOST -H 'Content-Type: application/json' 'https://<domain-end-point>/_snapshot/<repository-name>/<snapshot-name>/_restore' -d '
{
  "indices": "*",
  "ignore_unavailable": true,
  "include_global_state": true,
  "rename_pattern": ".kibana",
  "rename_replacement": "restored_.kibana"
}'

Trigger reindex with renaming restored_.kibana to .kibana

curl -XPOST -H 'Content-Type: application/json' 'https://<domain-end-point>/_reindex' -d '
{
  "source": {
    "index": "restored_.kibana"
  },
  "dest": {
    "index": ".kibana"
  }
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment