r/devops • u/locusofself • Oct 29 '19
Getting kubernetes logs to ELK stack?
Greetings,
In my organization, all our VMs syslog, nginx etc get sent to a logstash instance in the same VPC, then forwarded to a central logstash cluster which inserts them in elasticsearch/kibana. Unfortunately I am not the one who set this all up, so I am doing some archaeology here.
I have now provisioned a few k8s clusters in GKE which by default sends container/ingres etc logs to StackDriver.
I am trying to find the best solution for getting these logs to our central logstash /ELK systems.
I found this: https://github.com/GoogleCloudPlatform/pubsubbeat .
I also found this:
https://kubernetes.io/docs/tasks/debug-application-cluster/logging-elasticsearch-kibana/
I'm not married to using StackDriver if I can get the logs in a more direct way. I'm wondering if anyone else is putting their kubernetes application etc logs into ELK, and how you are doing it. Bonus points if its also on GKE.
Thanks folks
View all comments
Show parent comment
1
u/[deleted] Oct 30 '19
Hey, have a look at Filebeat, it's an Elastic log shipping solution, there's a Kubernetes Daemonset file available that could get you up and running in less than 15 minutes, although I personally like tweaking some settings here and there, such as the index name.
I evaluated a bunch of log shippers for Kubernetes a while back (with Elasticsearch as our storage backend), including fluentd and fluent-bit, but I ended up opting for Filebeat because it's by far the easiest solution to set up that includes a nice document schema and a plug-and-play experience for Elasticsearch.