I'm trying to reindex with environment variable. I have many indexes like service1- and service2- and want to reindex into monthly index, without having 10 near-identical actions.
I understood that i need to have entire field being an env variable, I don't do "${VAR1}-${VAR2}". But still I cannot get it to work.
I don't really want the default values but tried it, nothing works. I've tried both
index: "${CURATOR_DEST_INDEX:env-default-logstash-2018.08}"
and
index: "${CURATOR_DEST_INDEX}"
I run: bash
CURATOR_DEST_INDEX=logstash-2018.08.3
CURATOR_SOURCE_INDEX_PREFIX=test2-logstash-2018.08
curator actions/reindex-env.yml --config config/curator.yml
################################## My action:
actions:
1:
description: >-
Reindex all daily logstash indices into monthly indexes. Specified via environment variables:
action: reindex
options:
wait_interval: 9
max_wait: -1
request_body:
source:
index: REINDEX_SELECTION
dest:
index: "${CURATOR_DEST_INDEX:env-default-logstash-2018.08}"
filters:
- filtertype: pattern
kind: prefix
value: "${CURATOR_SOURCE_INDEX_PREFIX:logstash-2018.08.3}"
################################## End
################################## My Config
---
# 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']
################################## End
PS: The formatting 4-indent-codeblock didn't work, hence the crazy formatting in this note