google cloud platform – Getting syntax error for JOIN applied between two metrics
You mentioned you want to count all occurrences of MESSAGE as SUCCESS. But you are giving “Verify Completed” when you are filtering the verify_completed logs. So try using the SUCCESS in place of Verify Completed at the line filter jsonPayload.requestBody.success.message == "SUCCESS" and outer_join is not required.
fetch logging.googleapis.com/user/count_verify_country
| filter has(jsonPayload.requestBody.actors.client.verify.country)
| group_by [jsonPayload.requestBody.actors.client.daVinciFlow.flowExecutionId], [country: any(jsonPayload.requestBody.actors.client.verify.country)]
| join (
fetch logging.googleapis.com/user/verify_completed
| filter jsonPayload.requestBody.success.message == "SUCCESS"
| group_by [jsonPayload.requestBody.actors.client.daVinciFlow.flowExecutionId], [success_count: count()]
) on jsonPayload.requestBody.actors.client.daVinciFlow.flowExecutionId
| group_by [country], [total_success: sum(success_count)]
Refer to this official MQL example document for more information.
Read more here: Source link
