speedplane
speedplane

Reputation: 16121

Cloud Logging Advanced Log Filters: Find HTTP Requests >= Duration

Google's Advanced Cloud Logging Filters seem incredibly powerful, but equally complex to use. How does one craft a logging query that finds all HTTP requests with a duration longer than 3 seconds, which also contains the text foo bar?

I've read through the documentation, but it leaves a bit to be desired (it seems directed towards language authors, not users of the system). I know there is a field for Duration, but does anyone have an example on how to use it?

Update 4/2022: The documentation has gotten a lot better since writing this, take a look!

Upvotes: 4

Views: 3253

Answers (2)

Jeff Deskins
Jeff Deskins

Reputation: 1660

To filter logs by duration and text ("foo bar") for the default App Engine instance, you can run the following under advanced filter:

metadata.serviceName="appengine.googleapis.com"
metadata.labels."appengine.googleapis.com/module_id"="default"
log="appengine.googleapis.com/request_log"
protoPayload.latency > 3s
"foo bar"

Upvotes: 5

marcadian
marcadian

Reputation: 2618

Do you mean latency? Something like this should works

protoPayload.latency > 3s

Upvotes: 0

Related Questions