# Can not convert 'object' into 'string'

**URL:** <https://discuss.elastic.co/t/can-not-convert-object-into-string/97028>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [August 14, 2017, 10:35pm UTC](https://discuss.elastic.co/t/can-not-convert-object-into-string/97028 "2017-08-14T22:35:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![prophoto](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@prophoto](https://discuss.elastic.co/u/prophoto)\
**Post date:** [August 14, 2017, 10:35pm UTC](https://discuss.elastic.co/t/can-not-convert-object-into-string/97028/1 "2017-08-14T22:35:08Z")

</div>

Getting these errors, did a ton of searching around but no luck. Running bitnam elki vm on debian. and filebeat on centos7.

2017-08-14T21:44:38Z INFO Home path: [/usr/share/filebeat] Config path: [/etc/filebeat] Data path: [/var/lib/filebeat] Logs path: [/var/log/filebeat]  
2017-08-14T21:44:38Z INFO Setup Beat: filebeat; Version: 5.5.1  
2017-08-14T21:44:38Z ERR failed to initialize logstash plugin as output: can not convert 'object' into 'string' accessing 'output.logstash.ssl.certificate' (source:'/etc/filebeat/filebeat.yml')  
2017-08-14T21:44:38Z CRIT Exiting: error initializing publisher: can not convert 'object' into 'string' accessing 'output.logstash.ssl.certificate' (source:'/etc/filebeat/filebeat.yml')

```
filebeat.prospectors:

```

- input\_type: log  
paths:
  - /var/log/httpd/\*log
  - /var/log/secure
  - /var/log/messages

#----------------------------- Logstash output --------------------------------  
output.logstash:

# The Logstash hosts

hosts: ["[sub.domain.com:5044](http://sub.domain.com:5044)"]  
bulk\_max\_size: 1024  
ssl.certificate: ["/mypath/logstash-forwarder.crt"]  
ssl.key: ["/mypath/logstash-forwarder.key"]

---

<div class="post-metadata">

**Author:** ![prophoto](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@prophoto](https://discuss.elastic.co/u/prophoto)\
**Post date:** [August 14, 2017, 10:37pm UTC](https://discuss.elastic.co/t/can-not-convert-object-into-string/97028/2 "2017-08-14T22:37:13Z")

</div>

When setup without ssl on filebeat/logstash I get this error on filebeat.

ERR Connecting error publishing events (retrying): dial tcp my.ip.addr.ess:5044: i/o timeout

---

<div class="post-metadata">

**Author:** ![exekias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exekias/32/28718_2.png) [@exekias](https://discuss.elastic.co/u/exekias)\
**Post date:** [August 15, 2017, 9:41am UTC](https://discuss.elastic.co/t/can-not-convert-object-into-string/97028/3 "2017-08-15T09:41:03Z")

</div>

Hi @prophoto,

The problem is that you are setting an array as value for `ssl.certificate`, while Filebeat expects just a string. For details on how SSL is configured (across all beats), check [https://www.elastic.co/guide/en/beats/filebeat/current/configuration-output-ssl.html](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-output-ssl.html)

---

<div class="post-metadata">

**Author:** ![prophoto](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@prophoto](https://discuss.elastic.co/u/prophoto)\
**Post date:** [August 15, 2017, 6:27pm UTC](https://discuss.elastic.co/t/can-not-convert-object-into-string/97028/4 "2017-08-15T18:27:48Z")

</div>

So on filebeat I only need the certificate, right?

---

<div class="post-metadata">

**Author:** ![prophoto](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@prophoto](https://discuss.elastic.co/u/prophoto)\
**Post date:** [August 15, 2017, 6:40pm UTC](https://discuss.elastic.co/t/can-not-convert-object-into-string/97028/5 "2017-08-15T18:40:50Z")

</div>

OK so three more hours later all I had to do was remove the [] around the key and crt paths. Now Im getting ERR Connecting error publishing events (retrying): x509: certificate signed by unknown authority, help! Using self signed cert.

---

<div class="post-metadata">

**Author:** ![exekias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exekias/32/28718_2.png) [@exekias](https://discuss.elastic.co/u/exekias)\
**Post date:** [August 16, 2017, 9:31am UTC](https://discuss.elastic.co/t/can-not-convert-object-into-string/97028/6 "2017-08-16T09:31:07Z")

</div>

Try by adding the cert to `certificate_authorities`, or marking it as trusted in your system

---

<div class="post-metadata">

**Author:** ![prophoto](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@prophoto](https://discuss.elastic.co/u/prophoto)\
**Post date:** [August 16, 2017, 12:32pm UTC](https://discuss.elastic.co/t/can-not-convert-object-into-string/97028/7 "2017-08-16T12:32:09Z")

</div>

Working! On to the next step to get elk working as we need it to. Thanks

For anyone else this was my final config

> [@prophoto](#):
>
> hosts: [“[sub.domain.com:5044](http://sub.domain.com:5044)”]
> 
> bulk\_max\_size: 1024  
> ssl.certificate: "/mypath/logstash-forwarder.crt"  
> ssl.key: "/mypath/logstash-forwarder.key"  
> ssl.certificate\_authorities: ["/mypath/logstash-forwarder.crt"]

---

<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:** [September 13, 2017, 12:32pm UTC](https://discuss.elastic.co/t/can-not-convert-object-into-string/97028/8 "2017-09-13T12:32:13Z")

</div>

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