0

I'm attempting to set up a logs-based alert in GCP Log Explorer to monitor a table that receives new records daily. Occasionally, the number of records is low, sometimes below 1000. In such cases, I'd need to manually trigger the pipeline again when more data is available. I've tested the query below multiple times, but it doesn't seem to return the expected log results. In fact, it doesn't return any logs at all, even though there are logs indicating that fewer than 1000 records were inserted on certain days. I suspect the issue might lie in my syntax, particularly in line 6, but I haven't found any documentation addressing this specific concern.

resource.type="bigquery_dataset"
resource.labels.dataset_id="friend"
protoPayload.resourceName="projects/firebasereiss/datasets/friend/tables/clickbait"
protoPayload.authenticationInfo.principalEmail:"[email protected]"
protoPayload.methodName:"google.cloud.bigquery.v2.JobService.InsertJob"
protoPayload.metadata.tableDataChange.insertedRowsCount < 1000

1 Answer 1

0

The insertedRowsCount value is a string so it can't compare it with an int. The following line done the job:-

cast(protoPayload.metadata.tableDataChange.insertedRowsCount, INT64) < 10000
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.