# Logstash 2.3.1 elasticsearch config not working

**URL:** <https://discuss.elastic.co/t/logstash-2-3-1-elasticsearch-config-not-working/47942>\
**Category:** Logstash\
**Created:** [April 20, 2016, 5:53pm UTC](https://discuss.elastic.co/t/logstash-2-3-1-elasticsearch-config-not-working/47942 "2016-04-20T17:53:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mnhan](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@mnhan](https://discuss.elastic.co/u/mnhan)\
**Post date:** [April 20, 2016, 5:53pm UTC](https://discuss.elastic.co/t/logstash-2-3-1-elasticsearch-config-not-working/47942/1 "2016-04-20T17:53:49Z")

</div>

using logstash 2.2.0-1, the config works

output {  
elasticsearch {  
hosts =\> ["[test-es.corp.com/elasticsearch/](http://test-es.corp.com/elasticsearch/)"]  
ssl =\> true  
cacert =\> ""  
index =\> "system-%{YYYY.MM.dd}"  
}  
stdout { codec =\> rubydebug }  
}

in 2.3.1  
service logstash configtest  
configuration OK  
service logstash start  
  
wait a few minute, it dies  
logstash.log :  
`> {:timestamp=>"2016-04-20T12:15:27.146000-0500", :message=>"Pipeline aborted due to error", :exception=>#<LogStash::ConfigurationError: Host 'test-es.corp.com/elasticsearch' was specified, but is not valid! Use either a full URL or a hostname:port string!>,`

Fine: I change the output.conf file to :  
hosts =\> ["[https://test-es.corp.com/elasticsearch/](https://test-es.corp.com/elasticsearch/)"]

restart logstash, wait a bit, dies again:  
logstash.log now states:  
`{:timestamp=>"2016-04-20T12:29:32.963000-0500", :message=>"Pipeline aborted due to error", :exception=>#<LogStash::ConfigurationError: A path '/elasticsearch/' has been explicitly specified in the url 'https://test-es.corp.com/elasticsearch/', but you also specified a path of '/'. This is probably a mistake, please remove one setting.>`

[test-es.corp.com](http://test-es.corp.com) has elasticsearch on port 9200, listening only on localhost host. It has a ssl proxy which will forward request to the localhost:9200 via [https://test-es.corp.com/elasticsearch/](https://test-es.corp.com/elasticsearch/)

I can hit it via a web browser to get to elasticsearch. What is logstash conf wanting.  
I'm testing an upgrade before migrating our prod servers to the latest release.

---

<div class="post-metadata">

**Author:** ![mnhan](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@mnhan](https://discuss.elastic.co/u/mnhan)\
**Post date:** [April 21, 2016, 1:29pm UTC](https://discuss.elastic.co/t/logstash-2-3-1-elasticsearch-config-not-working/47942/2 "2016-04-21T13:29:53Z")

</div>

Looks like in 2.3.1, the output plugin wants you to specify the proxy path in "path". So to get this to work, I had to rewrite the old config to:

output {  
elasticsearch {  
hosts =\> ["[https://test-es.corp.com](https://test-es.corp.com)"]  
ssl =\> true  
cacert =\> 'blah/blah/cert.cer'  
path =\> "/elasticsearch/"  
}  
}

It doesn't like the path not being set and just specifying it in the url. The check fails and dies. It should ignore path if its not set and just use the path in the url. It shouldn't default the path to '/' if its not set. I believe this is a bug, but it can be worked around by just not specifying it in the url and adding it to path.

---

<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 6, 2017, 5:01am UTC](https://discuss.elastic.co/t/logstash-2-3-1-elasticsearch-config-not-working/47942/3 "2017-07-06T05:01:17Z")

</div>


