# Got response code '400' contacting Elasticsearch

**URL:** <https://discuss.elastic.co/t/got-response-code-400-contacting-elasticsearch/256276>\
**Category:** Logstash\
**Created:** [November 22, 2020, 2:32pm UTC](https://discuss.elastic.co/t/got-response-code-400-contacting-elasticsearch/256276 "2020-11-22T14:32:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rnx](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@Rnx](https://discuss.elastic.co/u/Rnx)\
**Post date:** [November 22, 2020, 2:32pm UTC](https://discuss.elastic.co/t/got-response-code-400-contacting-elasticsearch/256276/1 "2020-11-22T14:32:12Z")

</div>

Using local instance of Logstash 7.10. with output to Cloud services made an horror hours to me as it is 'pretty bad not telling a thing' issue, however:  
If your Logstash starts properly and connects to a cloud;  
If yout Logstash doesn't send any data to Elastic  
If your Logstash runs without any error, with only one repeating "WARNING";

```auto
[2020-11-22T11:32:53,717][WARN][logstash.outputs.elasticsearch][main] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"https://elastic:xxxxxx@xxxxx.westeurope.azure.elastic-cloud.com:9243/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError, :error=>"Got response code '400' contacting Elasticsearch at URL 'https://xxxxx.westeurope.azure.elastic-cloud.com:9243/'"}

```

My Logstash output conf:

```auto
output {
  elasticsearch {
    hosts => ["https:// ****.westeurope.azure.elastic-cloud.com:9243"]
    user => " ****"
    password => " ****"
    index => "filebeat-7.10.0"
  }
}

```

The issue is, you probably **mismatched Elasticsearch endpoint with Kibana endpoint**. That's it.

 ![endpoint](https://us1.discourse-cdn.com/elastic/original/3X/9/3/93dd70bdde98609f67521fd79083b40b189fbe8f.png)

---

<div class="post-metadata">

**Author:** ![Rnx](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@Rnx](https://discuss.elastic.co/u/Rnx)\
**Post date:** [November 22, 2020, 2:35pm UTC](https://discuss.elastic.co/t/got-response-code-400-contacting-elasticsearch/256276/2 "2020-11-22T14:35:08Z")

</div>

> [@Rnx](#):
>
> The issue is, you probably **mismatched Elasticsearch endpoint with Kibana endpoint**. That's it.

SOLVED: The issue is, you probably **mismatched Elasticsearch endpoint with Kibana endpoint**. That's it.

---

<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:** [December 20, 2020, 2:35pm UTC](https://discuss.elastic.co/t/got-response-code-400-contacting-elasticsearch/256276/3 "2020-12-20T14:35:11Z")

</div>

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