Facing problem to create curator.yml file?

Hi,

I've recently install curator on my server and i want to create curator config file and action file but i'm little bit confused about the path, where should i create both the file because in the documentation it's shown default path: ~/.curator/curator.yml, but on my server there is no default path exits.
But i have different curator path on my server.

Hi @letty12

In order to further debug your issue, I need some information.

  1. How you have installed curator on your server either by pip, yum or any other process.
  2. which environment you were using to install curator.

And I also want to know which other path do you have.

it's not mandatory to use default path:~/.curator/curator.yml.
you just add --config /path/to/curator.yml before the action yaml file argument.

hope the above steps will help you.

Thanks:)

@akhileshsingh

Thank you for your reply! Here are the information.

Using centos machine and install curator by using yum.

/use/bin/curator
/use/bin/elasticsearch-curator

Then where I have to create action file and how to use.

you need create the file by yourself. --config
curator --help see the configure.
see this:
https://www.elastic.co/guide/en/elasticsearch/client/curator/current/configfile.html

@letty12,

The path you have share it's a binary path of curator, where your curator is installed. you can also check by using below command.
whereis curator

Follow the below steps to use curator configuration file and action file, and resolve your query.

Step1:
create configuration file of curator.The default location of the configuration file is ~/.curator/curator.yml, it's not mandatory to create on the same path, you can create configuration file on any location, but you need to specified using the --config on the command line.
Use the below template to create curator.yml file.

#Remember, leave a key empty if there is no value. None will be a string,
#not a Python "NoneType"
client:
hosts:
- 127.0.0.1
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:
logformat: default
blacklist: ['elasticsearch', 'urllib3']

Step2:

Create action file either on the default location ~/.curator/action.yml or any another location. Create action file, which you need to perform on the indices.
use below template to create action file.

#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: ACTION1
description: OPTIONAL DESCRIPTION
options:
option1: value1
...
optionN: valueN
continue_if_exception: False
disable_action: True
filters:
- filtertype: first
filter_element1: value1
...
filter_elementN: valueN
- filtertype: second
filter_element1: value1
...
filter_elementN: valueN
2:
action: ACTION2
description: OPTIONAL DESCRIPTION
options:
option1: value1
...
optionN: valueN
continue_if_exception: False
disable_action: True
filters:
- filtertype: first
filter_element1: value1
...
filter_elementN: valueN
- filtertype: second
filter_element1: value1
...
filter_elementN: valueN
3:
action: ACTION3
...
4:
action: ACTION4
...

Step3:
Now perform the action using below command.

curator [--config CONFIG.YML] [--dry-run] ACTION_FILE.YML
a) If you were using default path to create both configuration and action file.
curator ~/.curator/curator.yml --dry-run ~/.curator/action.yml
b) If you were using any other location to create configuration and action file.
curator --config /path/of/curator.yml --dry-run /path/of/action.yml

You can also use curator binary path location instead of curator in command line interface.
For example: /usr/bin/curator [--config CONFIG.YML] [--dry-run] ACTION_FILE.YML

I hope the above steps will help to resolve your problem.
please feel free and revert in case of any query.

Thanks.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.