Curator restore index

Hello,
I want to use the curator to restore indexes from snapshots by template
restore.yml

actions:
1:
action: restore
description:> -
Restore index.
options:
repository: my_backup
skip_repo_fs_check: true
ignore_empty_list: True
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: pattern
kind: regex
value: '^ aktivka $'

gives error to curator.exceptions.NoSnapshots

I understand , my filter works on the snapshot name, not the index, how to defeat this problem?

Your paste is not properly formatted, so I can't tell what you have in your actual file. When pasting code, use the </> code tag in the editor, or encapsulate your text in triple back ticks like this:

```
PASTE HERE
```

However, if I might venture a guess, your regular expression value might have something to do with it:

You have spaces in your regex, which implies that you're looking for a snapshot name which starts and ends with a space, and has the value of " aktivka ", minus the quotes. Elasticsearch wouldn't let you create a snapshot with a name like that, so perhaps this is where the error is.

If you meant to imply that the "problem" is that you want to filter the indices in the restore, that's a different topic entirely.

I have a few snapshots
{
"snapshot" : "curator-20180513210004",
"uuid" : "DMd49NjpRfiVh8qWAPfHcQ",
"version_id" : 6020299,
"version" : "6.2.2",
"indices" : [
"aktivka-2018.04.28",
"asa-2018.04.28",
"metricbeat-6.2.3-2018.04.28",
"winlogbeat-6.2.2-2018.04.28"
],
"include_global_state" : true,
"state" : "SUCCESS",
"start_time" : "2018-05-13T21:00:32.378Z",
"start_time_in_millis" : 1526245232378,
"end_time" : "2018-05-13T21:05:05.421Z",
"end_time_in_millis" : 1526245505421,
"duration_in_millis" : 273043,
"failures" : [ ],
"shards" : {
"total" : 20,
"failed" : 0,
"successful" : 20
}
},
{
"snapshot" : "curator-20180514210002",
"uuid" : "MZeDqY9hTxCTrD4Sz24aVQ",
"version_id" : 6020299,
"version" : "6.2.2",
"indices" : [
"asa-2018.04.29",
"winlogbeat-6.2.2-2018.04.29",
"aktivka-2018.04.29",
"metricbeat-6.2.3-2018.04.29"
],
"include_global_state" : true,
"state" : "SUCCESS",
"start_time" : "2018-05-14T21:00:29.709Z",
"start_time_in_millis" : 1526331629709,
"end_time" : "2018-05-14T21:01:01.021Z",
"end_time_in_millis" : 1526331661021,
"duration_in_millis" : 31312,
"failures" : [ ],
"shards" : {
"total" : 20,
"failed" : 0,
"successful" : 20
}
},
{
"snapshot" : "curator-20180515210004",
"uuid" : "lztZokZfSvWBsaZb5JCc8Q",
"version_id" : 6020299,
"version" : "6.2.2",
"indices" : [
"asa-2018.04.30",
"winlogbeat-6.2.2-2018.04.30"
],
"include_global_state" : true,
"state" : "SUCCESS",
"start_time" : "2018-05-15T21:00:32.094Z",
"start_time_in_millis" : 1526418032094,
"end_time" : "2018-05-15T21:00:34.693Z",
"end_time_in_millis" : 1526418034693,
"duration_in_millis" : 2599,
"failures" : [ ],
"shards" : {
"total" : 10,
"failed" : 0,
"successful" : 10
}
}

and I want to restore all the indexes containing 'aktivka-'

The restore action can only restore from one snapshot at a time. You either specify the name of the snapshot, or Curator will use the most recent snapshot (regardless of what is in it).

Your configuration has not specified a setting for the indices option, which means that Curator would try to restore all indices from the designated snapshot. In Curator, indices must be specified using YAML array notation, which could be:

options:
  indices:
    - index1
    - index2

or

options:
  indices: ['index1', 'index2']

You can use multi-index syntax for each array element. This means you could simply specify

options:
  indices: ['aktivka-*']

for your indices option to get the desired effect.

thank you.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.