Quantcast
Channel: Delete Indices older than 30 days
Viewing all articles
Browse latest Browse all 11

Delete Indices older than 30 days

$
0
0

@waterwalker23 you can't quite use curator_cli that way. That's the older 3.x syntax. The new syntax is a bit more complex, since it tries to allow for complex filters.

What you're trying to do would be more like this:

curator_cli show_indices --filter_list '{"filtertype":"age","source":"name","timestring":"%Y.%m.%d","unit":"days","unit_count":30}'

Note that I replaced delete_indices with show_indices. That's kind of like a --dry-run, in that it shows you which indices would be acted on without doing anything to them. It's a great way to test your --filter_list and see exactly what will happen to your filtered indices.

Just be sure you don't have other indices with %Y.%m.%d in them that you don't want deleted, or they will be affected too, as there are no other filters.

This would look like this in a yaml file (you have to create it yourself):

---
actions:
  1:
    action: delete_indices
    description: Delete indices with %Y.%m.%d in the name where that date is older than 30 days
    options:
      ignore_empty_list: True
    filters:
      - filtertype: age
        source: name
        timestring: '%Y.%m.%d'
        unit: days
        unit_count: 30

If you were to save that file to say, /path/to/action.yml, all you'd have to do to run this would be:

curator --dry-run /path/to/action.yml

Again, I add --dry-run here so you don't accidentally delete anything before verifying.

Read full topic


Viewing all articles
Browse latest Browse all 11

Trending Articles