Google Stackdriver Logs Viewer: View function execution log entries if trace contains a given string?

101 Views Asked by At

If I query for a string it will only return the specific log entries that contain that string, but I am trying to view the full Cloud Function execution logs where this string is present (e.g., a given customer id).

Currently, I have to click "show entries from this trace" one at a time which is quite cumbersome, especially when I am trying to view multiple traces back to back. Is there any kind of query syntax to achieve this? Thanks.

1

There are 1 best solutions below

0
On

Yes, take a look at this tutorial in monitoring and logging executions. It also shows how to utilize the stackdriver and run queries.

You can get Cloud Function logs and choose how you want it to be returned:

  • Get a specific execution

  • Get a specific log

  • Get a specific log using regex

Additionally, In writing advanced queries in the query-editor field, check out the syntax notation from the Logging Query Language as it provides an in-depth explanation on how queries are structured. For examples of common queries, see sample queries.