# Error while setting up enviromental variables

**URL:** <https://discuss.elastic.co/t/error-while-setting-up-enviromental-variables/88532>\
**Category:** Logstash\
**Created:** [June 7, 2017, 8:49am UTC](https://discuss.elastic.co/t/error-while-setting-up-enviromental-variables/88532 "2017-06-07T08:49:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kvin](https://avatars.discourse-cdn.com/v4/letter/k/e99b99/32.png) [@Kvin](https://discuss.elastic.co/u/Kvin)\
**Post date:** [June 7, 2017, 8:49am UTC](https://discuss.elastic.co/t/error-while-setting-up-enviromental-variables/88532/1 "2017-06-07T08:49:29Z")

</div>

I have the following line in my Logstash RabbitMQ input:

`arguments => { "x-max-length" => 250000 }`

I want the value to be easily changable, so I would like to store it in an enviromental variable.

`arguments => { "x-max-length" => ${RMQ_ARG_X_MAX} }`

However this yields the following error on startup:

`Expected one of #, \", ', -, [, { at <some portion of the pipeline configuration> arguments => { \"x-max-length\" => "}`

If I change the config to

`arguments => { "x-max-length" => "${RMQ_ARG_X_MAX}" }`

Then I'll receive the following error:

[WARN][logstash.inputs.rabbitmq] Error while setting up connection for rabbitmq input! Will retry. {:message=\>"#method\<channel.close\>(reply-code=406, reply-text=PRECONDITION\_FAILED - inequivalent arg 'x-max-length'for queue '' in vhost '/': received the value '250000' of type 'longstr' but current is the value '250000' of type 'long', class-id=50, method-id=10)", :class=\>"MarchHare::ChannelAlreadyClosed", :location=\>"/usr/share/logstash/vendor/bundle/jruby/1.9/gems/march\_hare-2.22.0-java/lib/march\_hare/exceptions.rb:121:in `convert\_and\_reraise'"}

What should I do? It appears to me as if it only accepts the value as a number if I hardcode it to the pipeline configuration.

---

<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:** [June 11, 2017, 12:49pm UTC](https://discuss.elastic.co/t/error-while-setting-up-enviromental-variables/88532/2 "2017-06-11T12:49:28Z")

</div>

Yeah, this is a limitation of the Logstash configuration langauge.

---

<div class="post-metadata">

**Author:** ![Kvin](https://avatars.discourse-cdn.com/v4/letter/k/e99b99/32.png) [@Kvin](https://discuss.elastic.co/u/Kvin)\
**Post date:** [June 14, 2017, 9:22am UTC](https://discuss.elastic.co/t/error-while-setting-up-enviromental-variables/88532/3 "2017-06-14T09:22:12Z")

</div>

I see. Thank you for your answer! Do you think this is a subject worth opening a topic on Github for, or is it a limitation which simply cannot be fixed, not even in the far future?

---

<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:** [June 14, 2017, 9:28am UTC](https://discuss.elastic.co/t/error-while-setting-up-enviromental-variables/88532/4 "2017-06-14T09:28:34Z")

</div>

It's not an unreasonable change to request, but I wouldn't bet on it getting fixed.

---

<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:** [July 12, 2017, 9:28am UTC](https://discuss.elastic.co/t/error-while-setting-up-enviromental-variables/88532/5 "2017-07-12T09:28:43Z")

</div>

Closed on July 12, 2017, 9:28am UTC

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