# How to push log from Filebeat to Logstash/Elasticsearch affer setting secure TSL?

**URL:** <https://discuss.elastic.co/t/how-to-push-log-from-filebeat-to-logstash-elasticsearch-affer-setting-secure-tsl/287386>\
**Category:** Beats\
**Tags:** elastic-stack-security, filebeat\
**Created:** [October 22, 2021, 4:34am UTC](https://discuss.elastic.co/t/how-to-push-log-from-filebeat-to-logstash-elasticsearch-affer-setting-secure-tsl/287386 "2021-10-22T04:34:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nhattanmai](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nhattanmai/32/82550_2.png) [@nhattanmai](https://discuss.elastic.co/u/nhattanmai)\
**Post date:** [October 22, 2021, 4:34am UTC](https://discuss.elastic.co/t/how-to-push-log-from-filebeat-to-logstash-elasticsearch-affer-setting-secure-tsl/287386/1 "2021-10-22T04:34:28Z")

</div>

Dear all,  
I configured Encrypt traffic between Kibana and Elasticsearch successfully and now I can start Kibana (not yet https) and connected Elasticsearch

> **[Set up basic security for the Elastic Stack plus secured HTTPS traffic |...](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-basic-setup-https.html#encrypt-kibana-http)**

Here is Elasticsearch's setting:

```auto
network.host: 0.0.0.0
discovery.seed_hosts: []
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.client_authentication: required
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12
xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.keystore.path: http.p12

```

But I don't know how to connect Filebeat to Logstash or Elasticsearch after setting security for Elasticsearch. I try config Filebeat to connect with Elasticsearch but fail:

```auto
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["10.50.2.185:9200"]

  # Protocol - either `http` (default) or `https`.
  protocol: "https"
  #ssl_verification_mode: "none"

  # Authentication credentials - either API key or username/password.
  #api_key: "id:api_key"
  username: "beats_system"
  password: "XXXXXXXXX"

```

Error of filebeat:

```auto
2021-10-22T11:31:26.174+0700 ERROR [esclientleg] transport/logging.go:37 Error dialing x509: certificate signed by unknown authority {"network": "tcp", "address": "10.50.2.185:9200"}
2021-10-22T11:31:27.751+0700 ERROR [publisher_pipeline_output] pipeline/output.go:154 Failed to connect to backoff(elasticsearch(https://10.50.2.185:9200)): Get "https://10.50.2.185:9200": $
2021-10-22T11:31:27.751+0700 INFO [publisher_pipeline_output] pipeline/output.go:145 Attempting to reconnect to backoff(elasticsearch(https://10.50.2.185:9200)) with 1 reconnect attempt(s)
2021-10-22T11:31:27.751+0700 INFO [publisher] pipeline/retry.go:219 retryer: send unwait signal to consumer
2021-10-22T11:31:27.751+0700 INFO [publisher] pipeline/retry.go:223 done

```

I use username/password to authenticate with Elasticsearch but the log show about unknow certificate.  
How can I connect Filebeat with Elasticseach (or Logstash) with secure setting?  
Thank you!

---

<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:** [November 19, 2021, 6:35am UTC](https://discuss.elastic.co/t/how-to-push-log-from-filebeat-to-logstash-elasticsearch-affer-setting-secure-tsl/287386/2 "2021-11-19T06:35:19Z")

</div>

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