Debian Codegraph @

launcher/image/test/util/read_cloud_logging.sh

raw
1 #!/bin/bash
2
3 # read_cloud_logging reads the cloud logging of a test VM. It reads the logs for 1 day.
4 # It assumes the PROJECT_ID environment variable is set.
5 # Use var=$(read_cloud_logging <VM_NAME>) to capture the output of this command into a variable.
6 read_cloud_logging() {
7 gcloud logging read "resource.type=\"gce_instance\" jsonPayload._HOSTNAME=\"$1\"
8 log_name=\"projects/$PROJECT_ID/logs/confidential-space-launcher\"" \
9 --format="value(jsonPayload.MESSAGE)" --order asc
10 }