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

Fix yaml anchor #1361

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix yaml anchor #1361

wants to merge 3 commits into from

Conversation

qqshfox
Copy link

@qqshfox qqshfox commented Feb 15, 2019

Fixes yaml anchor

Proposed Changes

  • not modify the filters directly
  • instead modify a copied one

actions/delete-snapshots.yml

actions:
  10_kibana: &base
    action: delete_snapshots
    description: >-
      Delete snapshots from the selected repository older than 31 days
      (based on creation_date), for 'curator-' prefixed snapshots.
    options: &base_options
      repository: kibana
      ignore_empty_list: True
      disable_action: False
    filters:
    - filtertype: pattern
      kind: prefix
      value: curator-
      exclude:
    - filtertype: age
      source: creation_date
      direction: older
      unit: days
      unit_count: 31
  20_logstash:
    <<: *base
    options:
      <<: *base_options
      repository: logstash

console

$ curator --config curator.yml --dry-run actions/delete-snapshots.yml
2019-02-15 20:09:31,035 INFO      Preparing Action ID: 10_kibana, "delete_snapshots"
2019-02-15 20:09:31,111 INFO      Trying Action ID: 10_kibana, "delete_snapshots": Delete snapshots from the selected repository older than 31 days (based on creation_date), for 'curator-' prefixed snapshots.
2019-02-15 20:09:32,704 INFO      DRY-RUN MODE.  No changes will be made.
2019-02-15 20:09:32,704 INFO      Action ID: 10_kibana, "delete_snapshots" completed.
2019-02-15 20:09:32,704 INFO      Preparing Action ID: 20_logstash, "delete_snapshots"
2019-02-15 20:09:32,765 INFO      Trying Action ID: 20_logstash, "delete_snapshots": Delete snapshots from the selected repository older than 31 days (based on creation_date), for 'curator-' prefixed snapshots.
2019-02-15 20:09:33,118 ERROR     Schema error: required key not provided @ data['filtertype']
2019-02-15 20:09:33,118 ERROR     Failed to complete action: delete_snapshots.  <class 'curator.exceptions.ConfigurationError'>: Configuration: filter: Location: SnapshotList.iterate_filters: Bad Value: "(could not determine)", required key not provided @ data['filtertype']. Check configuration file.

@untergeek
Copy link
Member

Can you better describe the problem this fixes? I’ve seen no issue submitted for it.

@qqshfox
Copy link
Author

qqshfox commented Feb 15, 2019

Can you better describe the problem this fixes? I’ve seen no issue submitted for it.

updated with more details

@untergeek
Copy link
Member

Oh, I see. This allows for templating.

@untergeek
Copy link
Member

I know...I know. This is 5 years out. But if you can rebase this on the current branch, I will still merge this change.

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

Successfully merging this pull request may close these issues.

None yet

2 participants