I'd like to write a query that filters logs to only a particular hour of the day. This should retrieve logs at the same hour every day. For example, lets say the hour is 4pm / 16:00. It should retrieve logs with timestamp values:
I've tried using regex-based matching, but get an error "Field is of incorrect type. Regular expression matches can only be performed against string-compatible fields.":
timestamp=~"\d\d\d\d-\d\d-\d\dT16:\d\d:\d\d(\.\d+)?Z"
I've also tried accessing properties on this object, but that results in the error "Field 'timestamp' cannot have members.":
timestamp.hour=16
Is there some other way to filter logs by hour of day?
You can set specific limits on the date and time of log entries to show.
the preview displays exactly the log entries in the indicated 60-minute period and you won't be able to scroll outside of that date range:
timestamp >= "2023-01-18T16:00:00Z"
timestamp <= "2023-01-18T16:59:59Z"
Sample Filter for January 18 16:00:
resource.type="bigquery_resource"
protoPayload.serviceData.jobCompletedEvent.job.jobStatistics.totalBilledBytes>"0"
timestamp >= "2023-01-18T16:00:00Z"
timestamp <= "2023-01-18T216:59:59Z"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With