Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

GCP Batch - how can I find the failed tasks inside a job and print its sderr/stdout?

In Python, how can I find the failed tasks inside a job and print its sderr/stdout?

3 REPLIES 3

The example here https://cloud.google.com/batch/docs/analyze-job-using-logs#python only shows how to get the payload for all the tasks, so I am wondering

1. how I can filter the failed tasks

2.how to get the stdout and stderr from the tasks, not just a single payload (not sure what this represents in the first place)

 

 

Could some staff members help me with this? @Wen_gcp  @wenyhu @bolianyin @Shamel  Thanks! 

You can filter logs entries by task id. Please see answer in this post.

The example in that post uses Log Explorer, but you should be able to do the same with Cloud Logging python SDK where you can filter by label (task id).