# Logstash: Got response code '405' contacting Elasticsearch

**URL:** <https://discuss.elastic.co/t/logstash-got-response-code-405-contacting-elasticsearch/228723>\
**Category:** Logstash\
**Created:** [April 19, 2020, 11:02am UTC](https://discuss.elastic.co/t/logstash-got-response-code-405-contacting-elasticsearch/228723 "2020-04-19T11:02:51Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![tom55](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@tom55](https://discuss.elastic.co/u/tom55)\
**Post date:** [April 19, 2020, 11:02am UTC](https://discuss.elastic.co/t/logstash-got-response-code-405-contacting-elasticsearch/228723/1 "2020-04-19T11:02:51Z")

</div>

When trying to connect Logstash to ElasticSearch I'm getting this error and I don't understand why. The error mentions a "dead ES instance" but ElasticSearch is running and I'm able to access the API with curl from the server.  
Config : Debian 9

![Capture](https://us1.discourse-cdn.com/elastic/original/3X/e/e/eebe95aad4f1a4de5d92aba12585bf97ec0201a7.png)

Thanks

---

<div class="post-metadata">

**Author:** ![KrishnaShah7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krishnashah7/32/66810_2.png) [@KrishnaShah7](https://discuss.elastic.co/u/KrishnaShah7)\
**Post date:** [April 20, 2020, 1:40am UTC](https://discuss.elastic.co/t/logstash-got-response-code-405-contacting-elasticsearch/228723/2 "2020-04-20T01:40:07Z")

</div>

Hi @tom55 , Welcome to the community!  
Could you show us your logstash config file?

---

<div class="post-metadata">

**Author:** ![tom55](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@tom55](https://discuss.elastic.co/u/tom55)\
**Post date:** [April 20, 2020, 9:23am UTC](https://discuss.elastic.co/t/logstash-got-response-code-405-contacting-elasticsearch/228723/3 "2020-04-20T09:23:58Z")

</div>

Hello @KrishnaShah7

thanks for help

the config file conf.d ? logstash.yml ? logstash-sample.conf?

---

<div class="post-metadata">

**Author:** ![KrishnaShah7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krishnashah7/32/66810_2.png) [@KrishnaShah7](https://discuss.elastic.co/u/KrishnaShah7)\
**Post date:** [April 21, 2020, 12:28am UTC](https://discuss.elastic.co/t/logstash-got-response-code-405-contacting-elasticsearch/228723/4 "2020-04-21T00:28:23Z")

</div>

@tom55 : Logstash.yml please.

---

<div class="post-metadata">

**Author:** ![tom55](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@tom55](https://discuss.elastic.co/u/tom55)\
**Post date:** [April 21, 2020, 7:10am UTC](https://discuss.elastic.co/t/logstash-got-response-code-405-contacting-elasticsearch/228723/5 "2020-04-21T07:10:30Z")

</div>

Hello @KrishnaShah7

here is the conf file:  
[https://download1594.mediafire.com/z9tx6kzqwdhg/0u6lzeb3ky704d7/logstash.yml](https://download1594.mediafire.com/z9tx6kzqwdhg/0u6lzeb3ky704d7/logstash.yml)

---

<div class="post-metadata">

**Author:** ![KrishnaShah7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krishnashah7/32/66810_2.png) [@KrishnaShah7](https://discuss.elastic.co/u/KrishnaShah7)\
**Post date:** [April 22, 2020, 3:06am UTC](https://discuss.elastic.co/t/logstash-got-response-code-405-contacting-elasticsearch/228723/6 "2020-04-22T03:06:33Z")

</div>

Thanks @tom55 . Could you also send me your conf file ? I believe you have made your configuration in logstash-sample.conf ?

---

<div class="post-metadata">

**Author:** ![tom55](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@tom55](https://discuss.elastic.co/u/tom55)\
**Post date:** [April 22, 2020, 7:23am UTC](https://discuss.elastic.co/t/logstash-got-response-code-405-contacting-elasticsearch/228723/7 "2020-04-22T07:23:38Z")

</div>

> [@KrishnaShah7](#):
>
> Could you also send me your conf file ? I believe you have made your configuration in logstash-sample.conf ?

@KrishnaShah7 here is the file  
[https://www.mediafire.com/file/z7o7czc1soyjkgh/logstash-sample.conf/file](https://www.mediafire.com/file/z7o7czc1soyjkgh/logstash-sample.conf/file)  
thanks

---

<div class="post-metadata">

**Author:** ![KrishnaShah7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krishnashah7/32/66810_2.png) [@KrishnaShah7](https://discuss.elastic.co/u/KrishnaShah7)\
**Post date:** [April 26, 2020, 11:16pm UTC](https://discuss.elastic.co/t/logstash-got-response-code-405-contacting-elasticsearch/228723/8 "2020-04-26T23:16:00Z")

</div>

Hi @tom55 ,  
If you have TLS enabled, in your logstash conf output plugin, hosts =\> ["[http://localhost:9200](http://localhost:9200)"] won't work. You might want to check using https instead.

---

<div class="post-metadata">

**Author:** ![KrishnaShah7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krishnashah7/32/66810_2.png) [@KrishnaShah7](https://discuss.elastic.co/u/KrishnaShah7)\
**Post date:** [April 26, 2020, 11:16pm UTC](https://discuss.elastic.co/t/logstash-got-response-code-405-contacting-elasticsearch/228723/9 "2020-04-26T23:16:39Z")

</div>

Also have you enabled Xpack ? If yes, then that might require you to add some settings to your logstash.yml which you havent added.

---

<div class="post-metadata">

**Author:** ![tom55](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@tom55](https://discuss.elastic.co/u/tom55)\
**Post date:** [April 27, 2020, 7:19am UTC](https://discuss.elastic.co/t/logstash-got-response-code-405-contacting-elasticsearch/228723/10 "2020-04-27T07:19:02Z")

</div>

Hello,

the problem came from an incompatibility between logstash and ES which had different versions.

Thanks for help @KrishnaShah7

---

<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:** [May 25, 2020, 9:56am UTC](https://discuss.elastic.co/t/logstash-got-response-code-405-contacting-elasticsearch/228723/12 "2020-05-25T09:56:21Z")

</div>

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