Ship Kubernenetes events logs to kibana

How can we ship Kubernetes events logs to kibana.
ie: That we can get from kubectl get events command.
example output:

LAST SEEN   TYPE      REASON     OBJECT                 MESSAGE
47s         Warning   Failed     pod/similar-discover   Error: ImagePullBackOff
47m         Normal    Pulling    pod/snap-to-dest-v1 	Pulling image 
2m          Warning   Failed     pod/snap-to-dest-v2    Error: ImagePullBackOff
4m55s       Warning   Failed     pod/snap-to-road-v1    Error: ImagePullBackOff

Previously I have setup kubernetes logging using hints based autodiscover.
My filebeat configuration file is as follows:

filebeat.autodiscover:
      providers:
        - type: kubernetes
          node: ${NODE_NAME}
          templates:
             - condition:
                 not:
                   equals:
                     kubernetes.container.name: filebeat
               config:
                 - type: container
                   paths:
                   - /var/log/containers/*${data.kubernetes.container.id}.log
          
    fields_under_root: true  
    logging.json: true
    logging.to_stderr: true     
    

    output.kafka:
      enabled: true
      hosts:

        - host.docker.internal:9200
      topic: "%{[kafka_topic]}"
      required_acks: 1
      max_message_bytes: 10000000

So, is there any way to incorporate Kubernetes events means starting of pods, a restart of the pod, ImagePullBackOff, this type of information can be shipped to the kibana.

Or for shipping this events logs do we have to use other member of beat rather than filebeat any suggestion or how to proceed.

Thanks in Advance.

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