Error while setting up enviromental variables

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.

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

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?

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

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