Command Line Interface

edit

The 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.

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. Default: ~/.curator/curator.yml
  --dry-run      Do not perform any changes.
  --version      Show the version and exit.
  --help         Show this message and exit.

You can use environment variables in your configuration files.

Running Curator from Docker

edit

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.