Managed Service for MySQL API, gRPC: ClusterService.StreamLogs
Retrieves a log stream for a cluster.
This method is similar to ListLogs, but uses server-side streaming, which allows for the tail -f
command semantics.
gRPC request
rpc StreamLogs (StreamClusterLogsRequest) returns (stream StreamLogRecord)
StreamClusterLogsRequest
{
"clusterId": "string",
"columnFilter": [
"string"
],
"serviceType": "ServiceType",
"fromTime": "google.protobuf.Timestamp",
"toTime": "google.protobuf.Timestamp",
"recordToken": "string",
"filter": "string"
}
Field |
Description |
clusterId |
string Required field. ID of the cluster to stream logs for. To get this ID, make a ClusterService.List request. |
columnFilter[] |
string Columns from the logs table to request. |
serviceType |
enum ServiceType The log type.
|
fromTime |
Start timestamp for the logs request. |
toTime |
End timestamp for the logs request. In essence it has |
recordToken |
string Record token that can be used to control logs streaming. Set |
filter |
string A filter expression that selects clusters logs listed in the response. The expression must specify:
|
StreamLogRecord
{
"record": {
"timestamp": "google.protobuf.Timestamp",
"message": "string"
},
"nextRecordToken": "string"
}
A single log record in the logs stream.
Field |
Description |
record |
One of the requested log records. |
nextRecordToken |
string The token that can be used to continue streaming logs starting from the exact same record. This value is interchangeable with ListClusterLogsResponse.nextPageToken from ClusterService.ListLogs method. |
LogRecord
A single log record.
Field |
Description |
timestamp |
Timestamp of the log record. |
message |
string Contents of the log record. |