Cloud Logging Service, gRPC: LogReadingService.Read
Read log entries from the specified log group.
gRPC request
rpc Read (ReadRequest) returns (ReadResponse)
ReadRequest
{
// Includes only one of the fields `page_token`, `criteria`
"page_token": "string",
"criteria": {
"log_group_id": "string",
"resource_types": [
"string"
],
"resource_ids": [
"string"
],
"since": "google.protobuf.Timestamp",
"until": "google.protobuf.Timestamp",
"levels": [
"Level"
],
"filter": "string",
"stream_names": [
"string"
],
"page_size": "int64",
"max_response_size": "int64"
}
// end of the list of possible fields
}
Field |
Description |
page_token |
string Page token. To get the next page of results, set Includes only one of the fields Read selector. |
criteria |
Read criteria. See Criteria for details. Includes only one of the fields Read selector. |
Criteria
Read criteria. Should be used in initial ReadRequest.
Field |
Description |
log_group_id |
string Required field. ID of the log group to return. To get a log group ID make a LogGroupService.List request. |
resource_types[] |
string List of resource types to limit log entries to. Empty list disables filter. |
resource_ids[] |
string List of resource IDs to limit log entries to. Empty list disables filter. |
since |
Lower bound of log entries timestamps. |
until |
Upper bound of log entries timestamps. |
levels[] |
enum Level List of log levels to limit log entries to. Empty list disables filter.
|
filter |
string Filter expression. For details about filtering, see documentation. |
stream_names[] |
string List of stream names to limit log entries to. Empty list disables filter. |
page_size |
int64 The maximum number of results per page to return. |
max_response_size |
int64 Limits response to maximum size in bytes. Prevents gRPC resource exhaustion. Default value for max response size is 3.5 MiB |
ReadResponse
{
"log_group_id": "string",
"entries": [
{
"uid": "string",
"resource": {
"type": "string",
"id": "string"
},
"timestamp": "google.protobuf.Timestamp",
"ingested_at": "google.protobuf.Timestamp",
"saved_at": "google.protobuf.Timestamp",
"level": "Level",
"message": "string",
"json_payload": "google.protobuf.Struct",
"stream_name": "string"
}
],
"next_page_token": "string",
"previous_page_token": "string"
}
Field |
Description |
log_group_id |
string Log group ID the read was performed from. |
entries[] |
List of matching log entries. |
next_page_token |
string Token for getting the next page of the log entries. After getting log entries initially with Criteria, you can use Each subsequent page will have its own |
previous_page_token |
string Token for getting the previous page of the log entries. After getting log entries initially with Criteria, you can use Each subsequent page will have its own |
LogEntry
Field |
Description |
uid |
string Unique entry ID. Useful for logs deduplication. |
resource |
Entry resource specification. May contain information about source service and resource ID. |
timestamp |
Timestamp of the entry. |
ingested_at |
Entry ingestion time observed by LogIngestionService. |
saved_at |
Entry save time. Entry is ready to be read since this moment. |
level |
enum Level Entry severity. See LogLevel.Level for details.
|
message |
string Entry text message. |
json_payload |
Entry annotation. |
stream_name |
string Entry stream name. |
LogEntryResource
Log entry resource specification.
May be used either by services and by user.
Field |
Description |
type |
string Resource type, i.e., |
id |
string Resource ID, i.e., ID of the function producing logs. |