elastic / curator

Curator: Tending your Elasticsearch indices
Other
3.04k stars 635 forks source link

Curator_cli requires the use of the --config parameter (verified for 8.0.8) #1698

Closed Daniel314 closed 8 months ago

Daniel314 commented 8 months ago

Expected Behavior

Hi,

I've just upgraded to Elastic 8, which meant upgrading elastic-curator as well. When using the new version of curator_cli, it insists that I specify the --config parameter. I don't think this parameter should be mandatory.

Actual Behavior

When I invoke curator_cli without the --config parameter, I receive the following message: The error message returned when invoking curator_cli is: Error: Invalid value for '--config': Path '/xxxxxxxxxxxx/.curator/curator.yml' does not exist.

Steps to Reproduce the Problem

  1. Install Curator 8.0.8 (I installed via pip)
  2. Run: curator_cli --hosts http://localhost:9200 delete-indices --ignore_empty_list --filter_list '[{"filtertype":"pattern","kind":"prefix","value":"mylogstash-"},{"filtertype":"age", "source":"name", "direction":"older", "timestring":"%Y.%m.%d", "unit":"days", "unit_count":2},{"filtertype":"none"}]'

Specifications

Context (Environment)

I would prefer to be able to specify all parameters via the CLI, versus having to supply a "defaults" file for some/all of the parameters. As a workaround, I have added "--config /dev/null" to the CLI paramaters to get curator_cli to run.

Detailed Description

I believe that the --config parameter should be optional instead of mandatory. The current Elastic documentation (here: https://www.elastic.co/guide/en/elasticsearch/client/curator/current/singleton-cli.html) states that the YML configuration file is not required. Ideally, the documentation should clearly state that by default curator_cli will look for and use ~/.curator/curator.yml if it exists.

untergeek commented 8 months ago

You're right. I'll fix this in an upcoming release.