How to export previous logs in Stackdriver

前端 未结 4 1624
长情又很酷
长情又很酷 2021-02-19 02:43

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

4条回答
  •  猫巷女王i
    2021-02-19 03:40

    You can now do this from the gcloud CLI tool, with gcloud logging read: https://cloud.google.com/logging/docs/reference/tools/gcloud-logging#reading_log_entries

    Though in the scenario described, creating a log sink is the only way to capture events that are older than the stackdriver logging window, which is only 30 days even in the paid version.

提交回复
热议问题