[Solved] Environment variable references doesn't seem to work in output

Using 2.4.0 version of Logstash, I ve tried to use environment variable as index name setting of an elasticsearch output plugin as so:

I set env var :

export ES_IDX="test"

output part of config file

output {
  elasticsearch {
    hosts => ["127.0.0.1"]
    index => "${ES_IDX:test}-%{+YYYY.MM.dd}"
    manage_template => false
    workers => 4
  }
}

What I get is

Failed action. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"${ES_IDX:test}-2016.10.03" .... Invalid index name [${ES_IDX:test}-2016.10.03], must be lowercase]; "}}, :level=>:warn}

Did you start LS with the right flag? https://www.elastic.co/guide/en/logstash/current/environment-variables.html

Thank you @warkolm, yo are right :slight_smile: