# Logstash xpack.monitoring error for endpoint \_bulk with TLS/SSL

**URL:** <https://discuss.elastic.co/t/logstash-xpack-monitoring-error-for-endpoint-bulk-with-tls-ssl/223600>\
**Category:** Logstash\
**Tags:** elastic-stack-monitoring, elastic-stack-security\
**Created:** [March 14, 2020, 4:39am UTC](https://discuss.elastic.co/t/logstash-xpack-monitoring-error-for-endpoint-bulk-with-tls-ssl/223600 "2020-03-14T04:39:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![danksim](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@danksim](https://discuss.elastic.co/u/danksim)\
**Post date:** [March 14, 2020, 4:39am UTC](https://discuss.elastic.co/t/logstash-xpack-monitoring-error-for-endpoint-bulk-with-tls-ssl/223600/1 "2020-03-14T04:39:42Z")

</div>

Using images from [elastic/helm-charts](https://github.com/elastic/helm-charts)  
[elasticsearch](https://github.com/elastic/helm-charts/tree/master/elasticsearch) version: `6.8.2`  
[logstash](https://github.com/elastic/helm-charts/tree/master/logstash) version: `6.7.0`

* * *

Ever since enabling TLS for all ELK components, I am seeing the following error in logstash pod logs:

```auto
[2020-03-14T04:05:50,120][ERROR][logstash.outputs.elasticsearch] Encountered a retryable error. Will Retry with exponential backoff {:code=>400, :url=>"https://<k8s-es-service-name>:9200/_bulk"}

```

400 Bad Request... meaning the client (logstash) is making a bad request to the server (elasticsearch). But I couldn't figure out what the problem is.

* * *

elasticsearch.yml:

```auto
elasticsearch.yml: |
  # rest.action.multi.allow_explicit_index: false # tried this but did nothing
  xpack.monitoring.enabled: true
  xpack.security.enabled: true
  xpack.security.transport.ssl.enabled: true
  xpack.security.transport.ssl.verification_mode: certificate
  xpack.security.transport.ssl.keystore.path: /usr/share/elasticsearch/config/certs/elastic-certificates.p12
  xpack.security.transport.ssl.truststore.path: /usr/share/elasticsearch/config/certs/elastic-certificates.p12
  xpack.security.http.ssl.enabled: true
  xpack.security.http.ssl.truststore.path: /usr/share/elasticsearch/config/certs/elastic-certificates.p12
  xpack.security.http.ssl.keystore.path: /usr/share/elasticsearch/config/certs/elastic-certificates.p12

```

* * *

logstash.yml:

```auto
logstash.yml:
  xpack.monitoring.enabled: true
  xpack.monitoring.elasticsearch.hosts: ["<k8s-es-service-name>"]
  xpack.monitoring.elasticsearch.username: logstash_system
  xpack.monitoring.elasticsearch.password: logstash
  # xpack.monitoring.elasticsearch.ssl.ca: "/usr/share/logstash/pemCerts/elastic-certificate.pem"    
  # xpack.monitoring.elasticsearch.ssl.certificate_authority: /usr/share/logstash/certs/elastic-certificates.p12
  xpack.monitoring.elasticsearch.ssl.truststore.path: "/usr/share/logstash/certs/elastic-certificates.p12"
  xpack.monitoring.elasticsearch.ssl.truststore.password: ""
  xpack.monitoring.elasticsearch.ssl.keystore.path: "/usr/share/logstash/certs/elastic-certificates.p12"
  xpack.monitoring.elasticsearch.ssl.keystore.password: ""
  xpack.monitoring.elasticsearch.ssl.verification_mode: certificate
  xpack.monitoring.elasticsearch.sniffing: false
  xpack.monitoring.collection.interval: 60s
  xpack.monitoring.collection.pipeline.details.enabled: true

```

for `xpack.monitoring.elasticsearch.hosts`, I have tried most sensible variations like:

```auto
["https://<k8s-es-service-name>:9200"]
["<k8s-es-service-name>:9200"]
["<k8s-es-service-name>"]

```

* * *

logstash.conf:

```auto
logstash.conf: |
  output {
    elasticsearch {
      hosts => ["<k8s-es-service-name>"]
      ssl => true
      ssl_certificate_verification => true
      keystore => "/usr/share/logstash/certs/elastic-certificates.p12"
      keystore_password => ''
      truststore => "/usr/share/logstash/certs/elastic-certificates.p12"
      truststore_password => ''
      manage_template => false
      user => logstash_system
      password => password
      index => "<some-index>"  

```

for `hosts`, I have tried most sensible variations like:

```auto
["https://<k8s-es-service-name>:9200"]
["<k8s-es-service-name>:9200"]
["<k8s-es-service-name>"]

```

* * *

Would really appreciate any help. Thanks.

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [March 17, 2020, 8:58am UTC](https://discuss.elastic.co/t/logstash-xpack-monitoring-error-for-endpoint-bulk-with-tls-ssl/223600/2 "2020-03-17T08:58:57Z")

</div>

Can you share some logs from Elasticsearch and more logs from the logstash elasticsearch output plugin ?

---

<div class="post-metadata">

**Author:** ![danksim](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@danksim](https://discuss.elastic.co/u/danksim)\
**Post date:** [March 17, 2020, 8:37pm UTC](https://discuss.elastic.co/t/logstash-xpack-monitoring-error-for-endpoint-bulk-with-tls-ssl/223600/3 "2020-03-17T20:37:44Z")

</div>

Hi Ioannis, thanks for the reply.

I resolved this issue by adding the following values to `logstash.yml`:

```auto
logstash.yml:
  http.host: 0.0.0.0
  http.port: 9600
  ...

```

---

<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:** [April 14, 2020, 8:37pm UTC](https://discuss.elastic.co/t/logstash-xpack-monitoring-error-for-endpoint-bulk-with-tls-ssl/223600/4 "2020-04-14T20:37:46Z")

</div>

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