# After upgrade to 5.6.2 Logstash wont replace the environment variables

**URL:** <https://discuss.elastic.co/t/after-upgrade-to-5-6-2-logstash-wont-replace-the-environment-variables/106919>\
**Category:** Logstash\
**Created:** [November 8, 2017, 6:01pm UTC](https://discuss.elastic.co/t/after-upgrade-to-5-6-2-logstash-wont-replace-the-environment-variables/106919 "2017-11-08T18:01:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deepakv26](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@Deepakv26](https://discuss.elastic.co/u/Deepakv26)\
**Post date:** [November 8, 2017, 6:01pm UTC](https://discuss.elastic.co/t/after-upgrade-to-5-6-2-logstash-wont-replace-the-environment-variables/106919/1 "2017-11-08T18:01:20Z")

</div>

Hi,

We were using Logstash 1 and now we are upgrading to Logstash 5.6.2. As part of upgrade, we are doing the sanity check and we found that the environment variables are not getting replaced and we are getting the below error.

In output, we are using this environment variables.

output {  
xxxudp{  
host =\> "x.x.x.x"  
port =\> 1024  
codec =\> xxxcodec {  
template =\> "CEF:0|${deviceVendor}|${deviceProduct}|rt=${timestamp:2017-11-06T08:23:45:559Z} src=${sourceAddress:10.0.0.1} spt=${sourcePort:1234: 52} suser=${identity:ADMIN} sourceServiceName=${deviceService:vibhor\_srvc} deviceExternalId=${deviceExternalId:1152} deviceProcessName=${deviceProcessName:vibhor\_proc} outcome=${outcome:vibhor\_outcome} msg=${text:daemon\_vibhs}"  
facility =\> "USER"  
}  
}  
}

Can someone help us here?

"Cannot create pipeline  
{:reason=\>""Cannot evaluate `${deviceVendor}`.  
Environment variable `deviceVendor` is not set and there is no default value given."",  
:backtrace=\>[""/opt/logstash/logstash-core/lib/logstash/util/environment\_variables.rb:38:in `replace_env_placeholders'"", ""org/jruby/RubyString.java:3064:in`gsub'"",  
""/opt/logstash/logstash-core/lib/logstash/util/environment\_variables.rb:28:in `replace_env_placeholders'"", ""/opt/logstash/logstash-core/lib/logstash/util/environment_variables.rb:18:in`deep\_replace'"",  
""/opt/logstash/logstash-core/lib/logstash/config/mixin.rb:109:in `config_init'"", ""org/jruby/RubyHash.java:1342:in`each'"", ""/opt/logstash/logstash-core/lib/logstash/config/mixin.rb:108:in `config_init'"", ""/opt/logstash/logstash-core/lib/logstash/codecs/base.rb:19:in`initialize'"",  
""/opt/logstash/logstash-core/lib/logstash/pipeline.rb:112:in `plugin'"", ""(eval):8:in`initialize'"",  
""org/jruby/RubyKernel.java:1079:in `eval'"", ""/opt/logstash/logstash-core/lib/logstash/pipeline.rb:75:in`initialize'"",  
""/opt/logstash/logstash-core/lib/logstash/pipeline.rb:165:in `initialize'"", ""/opt/logstash/logstash-core/lib/logstash/agent.rb:286:in`create\_pipeline'"",  
""/opt/logstash/logstash-core/lib/logstash/agent.rb:95:in `register_pipeline'"", ""/opt/logstash/logstash-core/lib/logstash/runner.rb:313:in`execute'"",  
""/opt/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'"", ""/opt/logstash/logstash-core/lib/logstash/runner.rb:204:in`run'"",  
""/opt/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132:in `run'"", ""/opt/logstash/lib/bootstrap/environment.rb:71:in`(root)'""]}"

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 9, 2017, 10:02pm UTC](https://discuss.elastic.co/t/after-upgrade-to-5-6-2-logstash-wont-replace-the-environment-variables/106919/2 "2017-11-09T22:02:23Z")

</div>

How are you setting the deviceVendor environment variable?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 7, 2017, 10:02pm UTC](https://discuss.elastic.co/t/after-upgrade-to-5-6-2-logstash-wont-replace-the-environment-variables/106919/3 "2017-12-07T22:02:53Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
