Command Line Interfaceedit
Most common client configuration settings are now available at the command-line.
While both the configuration file and the command-line arguments can be used together, it is important to note that command-line options will override file-based configuration of the same setting.
The most basic command-line arguments are as follows:
curator [--config CONFIG.YML] [--dry-run] ACTION_FILE.YML
The square braces indicate optional elements.
If --config
and CONFIG.YML
are not provided, Curator will look in
~/.curator/curator.yml
for the configuration file. ~
is the home directory
of the user executing Curator. In a Unix system, this might be
/home/username/.curator/curator.yml
, while on a Windows system, it might be
C:\Users\username\.curator\curator.yml
If --dry-run
is included, Curator will simulate the action(s) in
ACTION_FILE.YML as closely as possible without actually making any changes. The
results will be in the logfile, or STDOUT/command-line if no logfile is
specified.
ACTION_FILE.YML
is a YAML actionfile.
For other client configuration options, command-line help is never far away:
curator --help
The help output looks like this:
$ curator --help Usage: curator [OPTIONS] ACTION_FILE Curator for Elasticsearch indices. See http://elastic.co/guide/en/elasticsearch/client/curator/current Options: --config PATH Path to configuration file. --hosts TEXT Elasticsearch URL to connect to --cloud_id TEXT Shorthand to connect to Elastic Cloud instance --id TEXT API Key "id" value --api_key TEXT API Key "api_key" value --username TEXT Username used to create "basic_auth" tuple --password TEXT Password used to create "basic_auth" tuple --bearer_auth TEXT --opaque_id TEXT --request_timeout FLOAT Request timeout in seconds --http_compress Enable HTTP compression --verify_certs Verify SSL/TLS certificate(s) --ca_certs TEXT Path to CA certificate file or directory --client_cert TEXT Path to client certificate file --client_key TEXT Path to client certificate key --ssl_assert_hostname TEXT Hostname or IP address to verify on the node's certificate. --ssl_assert_fingerprint TEXT SHA-256 fingerprint of the node's certificate. If this value is given then root-of-trust verification isn't done and only the node's certificate fingerprint is verified. --ssl_version TEXT Minimum acceptable TLS/SSL version --master-only Only run if the single host provided is the elected master --skip_version_test Do not check the host version --dry-run Do not perform any changes. --loglevel [DEBUG|INFO|WARNING|ERROR|CRITICAL] Log level --logfile TEXT log file --logformat [default|logstash|json|ecs] Log output format --version Show the version and exit. --help Show this message and exit.
You can use environment variables in your configuration files.
Running Curator from Dockeredit
Running Curator from the command-line using Docker requires only a few additional steps.
Docker-based Curator requires you to map a volume for your configuration files. Neglecting
to volume map your configuration directory to /.curator
and attempting to pass options at the
command-line will not work.
It looks like this:
docker run --rm --name myimagename \ -v /PATH/TO/MY/CONFIGS:/.curator \ untergeek/curator:mytag \ --config /.curator/config.yml /.curator/actionfile.yml
Both of the files config.yml
and actionfile.yml
should already exist in the path
/PATH/TO/MY/CONFIGS
before run time.
The --rm
in the command means that the container (not the image) will be deleted after
completing execution. You definitely want this as there is no reason to keep creating
containers for each run. The eventual cleanup from this would be unpleasant.