Curator: Use environment variables with Curator v4

Created on 21 Jul 2016  路  7Comments  路  Source: elastic/curator

I'm using 3.5 and it accepts flags. this works well with environment variables such as

--port ${PORT}, etc.

It's unclear in the v4 docs on how to do this with the change to a configuration file.
The config file has everything I need, but it doesn't show if it accepts environment variables/overrides. Is it possible without modifying the file to do string replacements?

feature_request

All 7 comments

I've never tried this, but I do not think it would be possible without string replacement. What's the use case that you're using environment variables? Docker, or some other container-style?

As an aside, I will be re-adding _some_ of the CLI functionality from 3.x in the future. It will not be able to do _all_ of the things that the YAML-based configuration can do, but much of it, plus a few other command-line only things (like show).

docker, yea

I recommend writing a wrapper for now. It should be fairly easy to do string replacement, even if it's done every time it's called (e.g. source file -> string replacement -> run against target).

The flags I was hoping to provide were SSL, ES username and password, and host.

Also would love this for Docker purposes. I ship a container that contains curator + a set of pre-baked curator scripts. Love to be able to tweak them via environment variables rather than editing conf files.

+1 - I'd like to use environment variables in the curator.yml and action-file.yml

Like curator.yml:

client:
  hosts:
    - ${HOSTNAME}
Was this page helpful?
0 / 5 - 0 ratings