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

Add configuration validation #674

Closed
hongyuan1306 opened this issue Jul 1, 2016 · 3 comments · Fixed by #742
Closed

Add configuration validation #674

hongyuan1306 opened this issue Jul 1, 2016 · 3 comments · Fixed by #742
Milestone

Comments

@hongyuan1306
Copy link

I am a new user to curator and with the latest version of curator (4.0.0) I started with the following action config:

actions:
  1:
    action: delete_indices
    fitlers:
    - filtertype: pattern
      kind: prefix
      value: logstash-
    - filtertype: age
      source: name
      timestring: '%Y.%m.%d'
      direction: older
      unit: days
      unit_count: 5

Instead of 'filters' i typed in 'fitlers', which is a fairly common error to make.

As a result, all my indices in elastics are removed. And it took me some time to figure out why this happened.

I would suggest that curator provide better protection against this sort of disaster. For example, when unrecognized options are encountered, an error shall be raised.

As in SQL, a statement like DELETE FROM table_name WHRER 1=1 shall not delete any thing.

@untergeek
Copy link
Member

I think that's worth pursuing.

As a rule, I advise using the --dry-run flag liberally when testing new configurations. The --dry-run flag is there so you can catch even legitimate configuration errors. I highly recommend it.

@hongyuan1306
Copy link
Author

It was my fault not having spent time to carefully read the output of dry run.

Actually I did use --dry-run. But as a new user of curator, the output seems somewhat cryptic to understand. By the way, it did not say there was any error with my configuration. So I just let it go.

However, with due respect, it did show which indices were to be removed.

@untergeek untergeek changed the title Better protection against typo in curator config file Add configuration validation Jul 1, 2016
@untergeek untergeek added this to the 4.1.0 milestone Jul 1, 2016
@evanvolgas
Copy link

Xref my stupid typo here: #730

Arguably some acceptable keywords in the config might make sense....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants