Home > Software engineering >  how to rename index while getting a snapshot usuing rename pattern?
how to rename index while getting a snapshot usuing rename pattern?

Time:09-30

i want to get a snapshot from repository, but instead log-events-2022.01.01 - events-2022.01.01. Can it possible replace 'log-' ?

POST _snapshot/snapshots/1/_restore
{
  "indices": "log-events-2022.01.01",
  "rename_pattern": "(. )",
  "rename_replacement": "events_$1"

}

CodePudding user response:

Tldr;

Update the regex, to mach the part you want to keep.

Solution

POST _snapshot/snapshots/1/_restore
{
  "indices": "log-events-2022.01.01",
  "rename_pattern": "log-(. )",
  "rename_replacement": "$1"

}
  • Related