-1

I'm attempting to update an existing sink using the (Python) Google Stackdriver Logging API, and am getting an error that I can't track down.

The API explorer for the method in question is here, to which I'm supplying projects/my_project/sinks/my_sink_name as the sinkName, and the following for the Request Body:

{
  "name": "audit_logs",
  "destination": "bigquery.googleapis.com/projects/my_project/datasets/destination_dataset",
  "filter": "resource.type=\"bigquery_resource\""
}

When submitting, I get the following error:

400 Bad Request

{
 "error": {
  "code": 400,
  "message": "Request contains an invalid argument.",
  "status": "INVALID_ARGUMENT"
 }
}

...which doesn't specify which argument is invalid, and I have tried several variations without any success.

Additional info: this request is based on one generated by the Python API. I have also tried specifying the full path of the sink in name to no avail, which is what the Python API generates, which seems contrary to the documentation.

cincodenada
  • 2,877
  • 25
  • 35

1 Answers1

1

Can you try the UpdateSink with uniqueWriterIdentity set to true?

From https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/update:

"It is an error if the old value is true and the new value is set to false or defaulted to false."

Summit Raj
  • 820
  • 5
  • 10