Find logs between timestamps using stackdriver CLI

The above answer doesn't seem to work anymore. Here's the new command.

gcloud logging read 'receiveTimestamp>="2019-08-08T21:00:00Z" AND receiveTimestamp<="2019-08-08T22:00:00Z"'

Actually, this is simpler. The escape characters has been removed along with the double "double quotes". :)


I'm a product manager with Stackdriver logging. We've tested the command and it seemed to work fine. The issue may be with Windows command shell? One guess is that perhaps the ">" and "<" need "/" in front? Copying and pasting your query into cloud shell works fine.

Kudos go to a Google engineer who recommended this: I came across this issue a lot with gcloud --filter commands on windows. The following works:

gcloud beta logging read "timestamp^>=""2017-02-19T00:00:00Z"" AND ""timestamp^<2017-03-14T00:00:00Z"""

Note use of double "" and ^ escape characters.

You can add --verbosity debug to the command line, it will show you how exactly parameters were understood by gcloud.