Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow filter_by_count() + 'pattern' to work with Snapshots #1588

Open
dekimsey opened this issue Feb 8, 2021 · 1 comment
Open

Allow filter_by_count() + 'pattern' to work with Snapshots #1588

dekimsey opened this issue Feb 8, 2021 · 1 comment

Comments

@dekimsey
Copy link

dekimsey commented Feb 8, 2021

For usage questions and help

Please create a topic at https://discuss.elastic.co/c/elasticsearch

Perhaps a topic there already has an answer for you!

To submit a bug or report an issue

Using a count filter with the pattern argument is not implemented for snapshots. Compare indexlist.py#L877 to snapshotlist.py#L335.

Expected Behavior

My goal is to prune snapshots. I was going to use count to partition the snapshots into buckets and then purge all but the most successful entry, but that doesn't seem to be supported.

Actual Behavior

2021-02-08 12:15:04,839 INFO      Trying Action ID: 0, "delete_snapshots": Prune snapshots
2021-02-08 12:15:36,528 ERROR     Failed to complete action: delete_snapshots.  <class 'TypeError'>: filter_by_count() got an unexpected keyword argument 'pattern'

Steps to Reproduce the Problem

actions:
  0:
    action: delete_snapshots
    description: Prune snapshots
    filters:
    - filtertype: pattern
      kind: regex
      value: '@archive\.'
    - filtertype: state
      state: SUCCESS
    - filtertype: count
      count: 1
      pattern: '^(.*)@archive\.\d{10}$'
      reverse: true
      exclude: true
    options:
      repository: onpremise-archive
      ignore_empty_list: true

Specifications

  • Version: 5.8.3
  • Platform: OSX 11.1
  • Subsystem: Python 3.8.3

Context (Environment)

Unable to prune snapshots effectively.

Detailed Description

n/a

@rayhan-am
Copy link

Hi
I had the same issue. so I checked out the code and I found out that filter_by_count() function only supports pattern in INDICES not in SNAPSHOTS.
I was wondering if you would mind supporting the "pattern" arg in snapshots too.
thanks

@untergeek untergeek changed the title filter_by_count() got an unexpected keyword argument 'pattern' Allow filter_by_count() + 'pattern' to work with Snapshots Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants