# Filebeat to Logstash TLS

**URL:** <https://discuss.elastic.co/t/filebeat-to-logstash-tls/233990>\
**Category:** Logstash\
**Tags:** elastic-stack-security\
**Created:** [May 23, 2020, 10:36am UTC](https://discuss.elastic.co/t/filebeat-to-logstash-tls/233990 "2020-05-23T10:36:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ethical20](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ethical20/32/68123_2.png) [@ethical20](https://discuss.elastic.co/u/ethical20)\
**Post date:** [May 23, 2020, 10:36am UTC](https://discuss.elastic.co/t/filebeat-to-logstash-tls/233990/1 "2020-05-23T10:36:35Z")

</div>

Hi,

I'm trying to set TLS communication between filebeat and logstash. I can see the documentation here [https://www.elastic.co/guide/en/beats/filebeat/current/configuring-ssl-logstash.html](https://www.elastic.co/guide/en/beats/filebeat/current/configuring-ssl-logstash.html) but this is in case of crt and key. But I have a .pem

How should my config be changed?

Here is the logstash.conf

```auto
# Sample Logstash configuration for creating a simple
# Beats -> Logstash -> Elasticsearch pipeline.

input {
  beats {
    port => 5044
    ssl => true
    ssl_certificate_authorities => ["/etc/kibana/elasticsearch-ca.pem"]
    
    #ssl_certificate => "/etc/server.crt"
    #ssl_key => "/etc/server.key"
    #cacert => '/home/amdin1/Desktop/elasticsearch-ca.pem'
    ssl_verify_mode => "force_peer"
  }
}

output {
  if [@metadata][pipeline] {
    elasticsearch {
     hosts => "https://192.168.2.220:9200"
     manage_template => false
     index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
     pipeline => "%{[@metadata][pipeline]}"
     user => "elastic"
     password => "@bc123"
     ssl => true
     cacert => '/etc/kibana/elasticsearch-ca.pem'
    }
  } else {
    elasticsearch {
      hosts => "https://192.168.2.220:9200"
      manage_template => false
      index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
      user => "elastic"
      password => "@bc123"
      ssl => true
      cacert => '/etc/kibana/elasticsearch-ca.pem'
    }
  }
}

```

Here is the logstash optput part in filebeat.yml (note that elasticsearch-ca.pem is copied from server to ubuntu client desktop)

```auto
#----------------------------- Logstash output --------------------------------
output.logstash:
  # The Logstash hosts
  hosts: ["192.168.2.220:5044"]

  # Optional SSL. By default is off.
  # List of root certificates for HTTPS server verifications
  ssl.certificate_authorities: ["/home/amdin/Desktop/elasticsearch-ca.pem"]
  # Certificate for SSL client authentication
  #ssl.certificate: "/etc/pki/client/cert.pem"

  # Client Certificate Key
  #ssl.key: "/etc/pki/client/cert.key"

```

Note: I already have the following:

- elastic-stack-ca.p12
- elastic-certificates.p12
- http.p12
- kibana-server.p12
- elasticsearch-ca.pem

Any help please?

Regards,

---

<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:** [June 20, 2020, 10:36am UTC](https://discuss.elastic.co/t/filebeat-to-logstash-tls/233990/2 "2020-06-20T10:36:36Z")

</div>

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