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
{
"cluster_id": "string",
"column_filter": [
"string"
],
"service_type": "ServiceType",
"from_time": "google.protobuf.Timestamp",
"to_time": "google.protobuf.Timestamp",
"record_token": "string",
"filter": "string"
}
Field |
Description |
cluster_id |
string Required field. ID of the cluster to stream logs for. To get this ID, make a ClusterService.List request. |
column_filter[] |
string Columns from the logs table to request. |
service_type |
enum ServiceType The log type.
|
from_time |
Start timestamp for the logs request. |
to_time |
End timestamp for the logs request. In essence it has |
record_token |
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": "map<string, string>"
},
"next_record_token": "string"
}
A single log record in the logs stream.
Field |
Description |
record |
One of the requested log records. |
next_record_token |
string The token that can be used to continue streaming logs starting from the exact same record. This value is interchangeable with ListClusterLogsResponse.next_page_token from ClusterService.ListLogs method. |
LogRecord
A single log record.
Field |
Description |
timestamp |
Timestamp of the log record. |
message |
object (map<string, string>) Contents of the log record. |