I have a log in Stackdriver that logs every request goes into my api and failed, and I want to write a script to count on the number of times each error message appears. The pro
Note that the filter is same as when you choose advanced filter in the Logging gui.
gcloud beta logging read "resource.type=\"gae_app\" resource.labels.module_id=\"api\" \"Ronald Reagan\"" --format=json --freshness=6d > x.txt