<p>guys
I want to watch all kubernetes events and I find the source code here: <a href="https://github.com/kubernetes/client-go/blob/master/informers/events/v1beta1/event.go" rel="nofollow noreferrer">https://github.com/kubernetes/client-go/blob/master/informers/events/v1beta1/event.go</a></p>

<p>However, I can not find any examples about how to use the functions.
Can anyone help me, thanks a lot!</p>

<p>I’d like to collect the event logs with <code>kubectl</code> or REST API[2] as JSON, then you 
 can send the logs to <code>fluentd</code> for centralized monitoring such as Elasticsearch.</p>

<p>Here is a good sample;[0], though it's OpenShift, but if <code>oc</code> cmd replace with <code>kubectl</code> cmd, it's same with Kubernetes. (Yeah, OpenShift is Enterprise Kubernetes). </p>

<p>[1] is how to implement the <code>fluentd</code> - <code>Elasticsearch</code> stack.</p>

<p>I hope this help you.</p>

<ul>
<li><p>[0] [<a href="https://docs.openshift.com/container-platform/3.9/security/monitoring.html#security-monitoring-events]" rel="nofollow noreferrer">https://docs.openshift.com/container-platform/3.9/security/monitoring.html#security-monitoring-events]</a></p></li>
<li><p>[1] [<a href="https://docs.fluentd.org/v0.12/articles/recipe-json-to-elasticsearch]" rel="nofollow noreferrer">https://docs.fluentd.org/v0.12/articles/recipe-json-to-elasticsearch]</a></p></li>
<li><p>[2] [<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#list-all-namespaces-292]" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#list-all-namespaces-292]</a></p></li>
</ul>
