Does the input and output plugins support variables?

I'm trying to set up a pipeline configuration with the following input filter:

rabbitmq {
	exchange => "exchange"
	host => "%{HOST}"
	queue => "queue"
	durable => true
	ack => true
	threads => 1
	prefetch_count => 1000
	password => "%{PWD}"
	user => "%{USER}"
}

The variables, %{HOST}, %{PWD} and %{USER} should be read from environmental variables, but Logstash complains in the logs that it can not connect to %{HOST}, because it takes it as a literal string.

I'm using 5.2.

What could cause this?

To read environment variables use ${FOO}, not %{FOO}.

1 Like

Thank you! That was it.

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