# Logstash JDBC Connection string multiple entries in Environment variable

**URL:** <https://discuss.elastic.co/t/logstash-jdbc-connection-string-multiple-entries-in-environment-variable/214801>\
**Category:** Logstash\
**Created:** [January 13, 2020, 10:47am UTC](https://discuss.elastic.co/t/logstash-jdbc-connection-string-multiple-entries-in-environment-variable/214801 "2020-01-13T10:47:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JP\_Smith](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jp_smith/32/60693_2.png) [@JP\_Smith](https://discuss.elastic.co/u/JP_Smith)\
**Post date:** [January 13, 2020, 10:47am UTC](https://discuss.elastic.co/t/logstash-jdbc-connection-string-multiple-entries-in-environment-variable/214801/1 "2020-01-13T10:47:07Z")

</div>

I want to add multiple entries in my environment variable and then pass them into my logstash jdbc connection string. When I do that it reads all the values in my variable at once and then fails with my connection attempt - is there a way around this?

The intention is to have this logstash input section run across multiple servers and the environment variable be dynamically read in. I have about 300+ servers which I need to run this against thus it is vital to have the servername in my connection string populated with a list.

Example below:  
This is how I set my variable, this works fine if I only have one server in the list:

> export ENV\_NAME="servername1,servername2"

Config file (not sure why my Dollar signs are being removed):

> "jdbc:sqlserver://${ENV\_NAME};user=secretuser;password=${ES\_PWD}"

---

<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:** [February 10, 2020, 10:47am UTC](https://discuss.elastic.co/t/logstash-jdbc-connection-string-multiple-entries-in-environment-variable/214801/2 "2020-02-10T10:47:15Z")

</div>

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