Here is a sample log from my project in gcp logger
{
"insertId": "________",
"jsonPayload": {
"stacktrace": "github.com_____",
"level": "error",
"msg": "could not update usage",
"caller": "pkg/_______.go:118",
"ts": ______.______,
"requestID": "c7taeaa23akg00e8r0tg",
"error": "write exception: write errors: [The field 'fieldName' must be an array but is of type null in document {_id: ObjectId('objectID001')}]"
},
"resource": {
"type": "cloud_run_revision",
"labels": {
"configuration_name": "configName",
"service_name": "serviceName",
"location": "us-central1",
"project_id": "projectID",
"revision_name": "revisionName"
}
},
"timestamp": "2022-02-02T15:45:45.867386Z",
"labels": {
"instanceId": "____________"
},
"logName": "projects/_____/logs/run.googleapis.com%2Fstderr",
"receiveTimestamp": "2022-02-02T15:45:45.967298989Z"
}
The issue is there are so many of logs with this exact content.
My question is that is there query or a set of queries that can be used to retrieve one log with same jsonPayload.error.
For example, if there are 6 logs in which 3 of them have same jsonPayload.error, what I need to achieve is to get 4 logs where the duplicate logs will get cancelled out and only one among them will be at the output along with the other 3 different logs.