Not able to find curator.yml (elasticsearch-curator) in linux

2.5k Views Asked by At

Official site of elasticsearch says the default config file exists in /home/username/.curator/curator.yml

https://www.elastic.co/guide/en/elasticsearch/client/curator/current/command-line.html

But there is no such folder. Also, I tried creating curator.yml and give path using --config option. But, it throws me error

curator --config ./curator.yml    
Error: no such option: --config

Installation was done using apt

sudo apt-get update && sudo apt-get install elasticsearch-curator

Help me create a config file as I want to delete my log-indexes

2

There are 2 best solutions below

0
On

Please note that the documentation does not say it that file exists after creation, it says:

If --config and CONFIG.YML are not provided, Curator will look in ~/.curator/curator.yml for the configuration file.

The file must be created by the end user.

Also, if you installed via:

sudo apt-get update && sudo apt-get install elasticsearch-curator

but did not add the official Elastic repository for Curator, then you installed an older version. Please check which version you are running with:

$ curator --version
curator, version 5.4.1

If you do not see the current version (5.4.1 at the time this answer was added), then you do not have the appropriate repository installed.

The official documentation provides an example client configuration file here.

There are also many examples of action files in the examples

0
On

Yes, one needs to create both the curator.yml as well as action.yml files. Since I am on centos 7, I happened to install curator from RPM, and in its default /opt/elastic-curator' I could follow up this good blog (but badly formatted!) : https://anchormen.nl/blog/big-data-services/monitoring-aws-redshift-with-elasticsearch/ to ge the files as follows(you may modify according to your needs) :

curator.yml

---
# Remember, leave a key empty if there is no value.  None will be a string,
# not a Python "NoneType"
client:
  hosts:
    - <host1>
    - <host2, likewise upto hostN > 
  port: 9200
  url_prefix:
  use_ssl: False
  certificate:
  client_cert:
  client_key:
  ssl_no_validate: False
  http_auth:
  timeout: 30
  master_only: False

logging:
  loglevel: INFO
  logfile: /var/log/curator.log
  logformat: default
  blacklist: []

and an action.yml as follows :

---
# Remember, leave a key empty if there is no value.  None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True.  If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
  1:
    action: rollover
    description: Rollover the index associated with index 'name', which should be in the form of prefix-000001 (or similar),or prefix-YYYY.MM.DD-1.
    options:
      disable_action: False
      name: redshift_metrics_daily
      conditions:
        max_age: 1d
      extra_settings:
        index.number_of_shards: 2
        index.number_of_replicas: 1
  2:
    action: rollover
    description: Rollover the index associated with index 'name' , which should be in the form of prefix-000001 (or similar), or prefix-YYYY.MM.DD-1.
    options:
      disable_action: False
      name: redshift_query_metadata_daily
      conditions:
        max_age: 1d
      extra_settings:
        index.number_of_shards: 2
        index.number_of_replicas: 1