# Ship Kubernetes logs to Logstash

**URL:** <https://forums.suse.com/t/ship-kubernetes-logs-to-logstash/6330>\
**Category:** Rancher 1.x\
**Created:** [May 8, 2017, 6:10am UTC](https://forums.suse.com/t/ship-kubernetes-logs-to-logstash/6330 "2017-05-08T06:10:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![laszlocloud](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/laszlocloud/32/2439_2.png) [@laszlocloud](https://forums.suse.com/u/laszlocloud)\
**Post date:** [May 8, 2017, 6:10am UTC](https://forums.suse.com/t/ship-kubernetes-logs-to-logstash/6330/1 "2017-05-08T06:10:42Z")

</div>

Hello,

would like to know how others solved the question. I have a working solution, but generally interested how you did it.

Here is the result of a day spent reading:

- The Kubernetes ecosystem works with Fluentd mostly (so did Openshift in my previous project)
- Fluentd has nice container metadata [https://github.com/fluent/fluentd-kubernetes-daemonset](https://github.com/fluent/fluentd-kubernetes-daemonset)
- Fluentd can’t talk to logstash BUMMER
- Filebeat talks to Logstash, Kubernetes is not their main usecase, they don’t have nice defaults like the above linked Fluentd daemonset.
- But the only thing the Fluentd daemonset adds as metadata is coming from a plugin, that is essentially slicing up log file names.
- Luckily someone did it already: [github.com/ApsOps/filebeat-kubernetes](http://github.com/ApsOps/filebeat-kubernetes)

So as of now, I use [https://github.com/ApsOps/filebeat-kubernetes](https://github.com/ApsOps/filebeat-kubernetes) on my testing cluster to ship logs to Logstash.

Looking forward to hear other takes.

Take care.  
Laszlo

---

<div class="post-metadata">

**Author:** ![ITBlogger](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/itblogger/32/4531_2.png) [@ITBlogger](https://forums.suse.com/u/ITBlogger)\
**Post date:** [August 28, 2018, 4:17pm UTC](https://forums.suse.com/t/ship-kubernetes-logs-to-logstash/6330/2 "2018-08-28T16:17:57Z")

</div>

We are using the official filebeat and metricbeat deployment/daemonset configs with some tweaks.

Also using filebeat hint based autodiscover to properly deal with multiline logs.

Filebeat daemonset pods send logs to logstash, metricbeat pods send data directly to kibana/elasticsearch.

We’re using Elastalert for alerting, currently just to Slack

So far it’s working very well. But that’s really only just now been the case. Metricbeat had issues with changes made to kube-state-metrics that weren’t fixed until Metricbeat 6.4.0, but now that those issues have been fixed, it’s pretty golden.

–Alex
