grok_exporter icon indicating copy to clipboard operation
grok_exporter copied to clipboard

Apply grok_exporter to k8s

Open majulong opened this issue 5 years ago • 2 comments
trafficstars

I wonder how to use this exporter to k8s pod's logs. anyone can help me? thanks

majulong avatar Mar 19 '20 04:03 majulong

It depends on what exactly you want to achieve. One simple way is to use the kubectl logs command to print the logs to the stdout, and to pipe it into a grok_exporter with input type stdin, like this:

kubectl logs ... | grok_exporter -config ./config.yaml

Does that help?

fstab avatar Mar 22 '20 21:03 fstab

thinks, that would be help, but I wanna use the exporter inside pod like sidecar, when the pod have new logs, the exporter can work at once. And the pod doesn't have the log file, only can get the logs by stdout.

majulong avatar Mar 23 '20 01:03 majulong