0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

gcloudコマンドで、Cloud Loggingのログをコピーする

Last updated at Posted at 2025-09-21

概要

  • Cloud Runでエラーがでる。これをコピーしたい
  • コンソール上だとなんかしらないがコピペしづらいし、ログがラインごとにでてくるのでこれもコピペしづらい
    • なんかどっかで1レコードで出せる的な記事見たいような気がするが
  • これをgcloudで取得して、そのままClaude CodeやGemini CLIに貼れるようにしたい

できた

$ gcloud logging read \
    "resource.type=cloud_run_revision AND labels.instanceId=\"${INSTANCE_ID}\"" \
    --limit=200 \
    --format=json \
    --project=${PROJECT_ID} \
    | jq '.[].textPayload' \
    | pbcopy

雑感

  • 巧みな権限管理で、調査依頼もAIでいけそう

参考URL

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?