# Secure Communication Between Filebeat and Logstash

**URL:** <https://discuss.elastic.co/t/secure-communication-between-filebeat-and-logstash/102552>\
**Category:** Logstash\
**Created:** [October 3, 2017, 11:47am UTC](https://discuss.elastic.co/t/secure-communication-between-filebeat-and-logstash/102552 "2017-10-03T11:47:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aditya\_soni](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@aditya\_soni](https://discuss.elastic.co/u/aditya_soni)\
**Post date:** [October 3, 2017, 11:47am UTC](https://discuss.elastic.co/t/secure-communication-between-filebeat-and-logstash/102552/1 "2017-10-03T11:47:24Z")

</div>

Hi All,

I am trying to configuring the secure communication between Logstash and Filebeat by the reference of  
the link provided [https://www.elastic.co/guide/en/beats/filebeat/current/configuring-ssl-logstash.html#testing-ssl-logstash](https://www.elastic.co/guide/en/beats/filebeat/current/configuring-ssl-logstash.html#testing-ssl-logstash)

## These is my Filebeat.yml file-

```
    filebeat.prospectors: 
      - 
        document_type: gatewaylogs
        input_type: log
        paths: "C:/Users/ak250751/Documents/My Received Files/GatewayService-Processor.Transactions-20170830.slog"
    output.logstash: 
      hosts: 
        - "153.53.32.69"
      ssl.certificate: "C:/Certificate/FileBeateCert/Certs~/ca/ca.crt"
      ssl.certificate_authorities: 
        - "C:/Certificate/FileBeateCert/Certs~/FilebeatServer/FilebeatServer.crt"
      ssl.key: "C:/Certificate/FileBeateCert/Certs~/FilebeatServer/FilebeatServer.key" 

```

And this is my Logstash Config File:-1:

```
input{
  beats{
    port=>5043
    ssl => true
    ssl_certificate_authorities => ["E:\ELK-STACK\filebeat-5.5.1-windows-x86_64\filebeat-5.5.1-windows-x86_64\etc\ca.crt"]
    ssl_certificate => "E:\ELK-STACK\filebeat-5.5.1-windows-x86_64\filebeat-5.5.1-windows-x86_64\etc\LogstashClient.crt"
    ssl_key => "E:\ELK-STACK\filebeat-5.5.1-windows-x86_64\filebeat-5.5.1-windows-x86_64\etc\LogstashClient.key"
    ssl_verify_mode => "force_peer"
	}

```

This is my instance.yml file , which i used for creating certificate using certgen tool-

```
instances:
  - name: "FilebeatServer" 
    ip: 
      - "153.53.32.69"
  - name: "LogstashClient"
    ip:
      - "153.53.41.26"

```

So by using command - `xpack/bin/certgen -in instance.yml` i got three folders.

a) FilebeatServer- contains- .crt and .key file.  
b) LogstashServer- conatins- .crt and .key file.  
c) ca- contains ca.crt and ca.key,

So on doing all the above configuration,

On starting the Filebeat Service I am getting the following Error-

```
2017/10/03 10:14:10.381631 outputs.go:102: ERR failed to initialize logstash plugin as output: 1 error: tls: private key does not match public key
2017/10/03 10:14:10.383637 beat.go:339: CRIT Exiting: error initializing publisher: 1 error: tls: private key does not match public key
Exiting: error initializing publisher: 1 error: tls: private key does not match public key

```

I thought i am doing configuration of certificates in a wrong manner.  
please suggest me the way.

Thanks.

---

<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:** [October 31, 2017, 11:47am UTC](https://discuss.elastic.co/t/secure-communication-between-filebeat-and-logstash/102552/2 "2017-10-31T11:47:47Z")

</div>

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