# exception=\>"Java::JavaNet::URISyntaxException", :message=\>"Illegal character in path at index 0: \[\\"esi1\\",\\"esi2\\"\]"

**URL:** <https://discuss.elastic.co/t/exception-java-urisyntaxexception-message-illegal-character-in-path-at-index-0-esi1-esi2/165456>\
**Category:** Logstash\
**Created:** [January 23, 2019, 4:44pm UTC](https://discuss.elastic.co/t/exception-java-urisyntaxexception-message-illegal-character-in-path-at-index-0-esi1-esi2/165456 "2019-01-23T16:44:05Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [January 23, 2019, 5:13pm UTC](https://discuss.elastic.co/t/exception-java-urisyntaxexception-message-illegal-character-in-path-at-index-0-esi1-esi2/165456/4 "2019-01-23T17:13:23Z")

</div>

Yes, I understand what you are trying to do. The code that processes hosts expects to receive either a string containing a single host, or an array containing mulitple hosts. When you do that variable substitution it gets passed a string containing multiple hosts, and that does not work.

If it is always two hosts then you can use

```
hosts => ["${HOST1}", "${HOST2}"]
```

---

_[View the full topic](https://discuss.elastic.co/t/exception-java-urisyntaxexception-message-illegal-character-in-path-at-index-0-esi1-esi2/165456)._
