I have a running Kubernetes cluster that aggregates it's logfiles in stackdriver and would like to tail the aggregated logs on the command line. But so far I am only able to view the json stream float by in the web interface or fetch historic logging data with a command like gcloud beta logging read 'resource.type="container" jsonPayload.service:("my-service") timestamp >= "2017-06-22T16:00:00+02:00"' --format=json.

Is there no way in GCE for me to build an aggregated real time view of the current log entries, like you would get from a tail -f?

  • 1
    You can stream logs from the GCE VM instances by installing the stackdriver logging agent on the GCE VM instances. Google container engine does not require this agent. Instructions are available at this link. Once installed, you will be able to stream the aggregated VM instances logs real-time similar to container engine logs you already been able to stream. Let me know if it helps, if not add more information for the use case.
    – N Singh
    Commented Aug 23, 2017 at 18:19

1 Answer 1


The only realtime like thing that you could use is to create a sink from Stackdriver to Pub/Sub and create a consumer that will receive in almost real time, messages from SD; the other options are based on sending chunks of information every X time and won't be as near realtime as you would like.

You can read about exporting logs in Googles SD documentation for that matter.

I hope this information can help you solve your issue.

Regards! -JP

  • I wanted to downvote you... but then I've figured out it's not your fault, great answer but bad solution
    – confiq
    Commented May 6, 2020 at 8:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .