简体   繁体   中英

How can I collect the pod logs using fluentd and send the logs to elasticsearch?

I am trying to push the stdout logs which we see using below command to the elastic search using fluentd. I am not sure what can I do?

Kubectl logs -f <podname>

This shows all the SYSOUT logs getting printed via Java application. I want these logs to be available in elasticsearch.

Did you check this ?

From above link

  1. Get fluentd deamonset
  2. Tweak the deamonset manifest file like below(as mentioned in that link)
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: fluentd
  namespace: kube-system
  ...
spec:
    ...
    spec:
      containers:
      - name: fluentd
        image: quay.io/fluent/fluentd-kubernetes-daemonset
        env:
          - name:  FLUENT_ELASTICSEARCH_HOST
            value: "elasticsearch-logging"
          - name:  FLUENT_ELASTICSEARCH_PORT
            value: "9200"
        ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM