Shape the future of software operations and make your voice heard by taking the 2023 State of DevOps survey.

Package google.logging.v2

Index

ConfigServiceV2

Service for configuring sinks used to route log entries.

CopyLogEntries

rpc CopyLogEntries(CopyLogEntriesRequest) returns (Operation)

Copies a set of log entries from a log bucket to a Cloud Storage bucket.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

CreateBucket

rpc CreateBucket(CreateBucketRequest) returns (LogBucket)

Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

CreateBucketAsync

rpc CreateBucketAsync(CreateBucketRequest) returns (Operation)

Creates a log bucket asynchronously that can be used to store log entries.

After a bucket has been created, the bucket's location cannot be changed.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

CreateExclusion

rpc CreateExclusion(CreateExclusionRequest) returns (LogExclusion)

Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

CreateSink

rpc CreateSink(CreateSinkRequest) returns (LogSink)

Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

CreateView

rpc CreateView(CreateViewRequest) returns (LogView)

Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

DeleteBucket

rpc DeleteBucket(DeleteBucketRequest) returns (Empty)

Deletes a log bucket.

Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

DeleteExclusion

rpc DeleteExclusion(DeleteExclusionRequest) returns (Empty)

Deletes an exclusion in the _Default sink.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

DeleteSink

rpc DeleteSink(DeleteSinkRequest) returns (Empty)

Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

DeleteView

rpc DeleteView(DeleteViewRequest) returns (Empty)

Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetBucket

rpc GetBucket(GetBucketRequest) returns (LogBucket)

Gets a log bucket.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.read
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetCmekSettings

rpc GetCmekSettings(GetCmekSettingsRequest) returns (CmekSettings)

Gets the Logging CMEK settings for the given resource.

Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.

See Enabling CMEK for Log Router for more information.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.read
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetExclusion

rpc GetExclusion(GetExclusionRequest) returns (LogExclusion)

Gets the description of an exclusion in the _Default sink.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.read
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetSettings

rpc GetSettings(GetSettingsRequest) returns (Settings)

Gets the Log Router settings for the given resource.

Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.

See Enabling CMEK for Log Router for more information.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.read
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetSink

rpc GetSink(GetSinkRequest) returns (LogSink)

Gets a sink.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.read
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetView

rpc GetView(GetViewRequest) returns (LogView)

Gets a view on a log bucket..

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.read
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListBuckets

rpc ListBuckets(ListBucketsRequest) returns (ListBucketsResponse)

Lists log buckets.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.read
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListExclusions

rpc ListExclusions(ListExclusionsRequest) returns (ListExclusionsResponse)

Lists all the exclusions on the _Default sink in a parent resource.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.read
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListSinks

rpc ListSinks(ListSinksRequest) returns (ListSinksResponse)

Lists sinks.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.read
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListViews

rpc ListViews(ListViewsRequest) returns (ListViewsResponse)

Lists views on a log bucket.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.read
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UndeleteBucket

rpc UndeleteBucket(UndeleteBucketRequest) returns (Empty)

Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateBucket

rpc UpdateBucket(UpdateBucketRequest) returns (LogBucket)

Updates a log bucket.

If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.

After a bucket has been created, the bucket's location cannot be changed.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateBucketAsync

rpc UpdateBucketAsync(UpdateBucketRequest) returns (Operation)

Updates a log bucket asynchronously.

If the bucket has a lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.

After a bucket has been created, the bucket's location cannot be changed.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateCmekSettings

rpc UpdateCmekSettings(UpdateCmekSettingsRequest) returns (CmekSettings)

Updates the Log Router CMEK settings for the given resource.

Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.

UpdateCmekSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled.

See Enabling CMEK for Log Router for more information.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateExclusion

rpc UpdateExclusion(UpdateExclusionRequest) returns (LogExclusion)

Changes one or more properties of an existing exclusion in the _Default sink.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateSettings

rpc UpdateSettings(UpdateSettingsRequest) returns (Settings)

Updates the Log Router settings for the given resource.

Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.

UpdateSettings will fail if 1) kms_key_name is invalid, or 2) the associated service account does not have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or 3) access to the key is disabled. 4) location_id is not supported by Logging. 5) location_id violate OrgPolicy.

See Enabling CMEK for Log Router for more information.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateSink

rpc UpdateSink(UpdateSinkRequest) returns (LogSink)

Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: destination, and filter.

The updated sink might also have a new writer_identity; see the unique_writer_identity field.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateView

rpc UpdateView(UpdateViewRequest) returns (LogView)

Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

LoggingServiceV2

Service for ingesting and querying logs.

DeleteLog

rpc DeleteLog(DeleteLogRequest) returns (Empty)

Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListLogEntries

rpc ListLogEntries(ListLogEntriesRequest) returns (ListLogEntriesResponse)

Lists log entries. Use this method to retrieve log entries that originated from a project/folder/organization/billing account. For ways to export log entries, see Exporting Logs.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.read
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListLogs

rpc ListLogs(ListLogsRequest) returns (ListLogsResponse)

Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.read
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListMonitoredResourceDescriptors

rpc ListMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest) returns (ListMonitoredResourceDescriptorsResponse)

Lists the descriptors for monitored resource types used by Logging.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.read
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

TailLogEntries

rpc TailLogEntries(TailLogEntriesRequest) returns (TailLogEntriesResponse)

Streaming read of log entries as they are ingested. Until the stream is terminated, it will continue reading logs.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.read
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

WriteLogEntries

rpc WriteLogEntries(WriteLogEntriesRequest) returns (WriteLogEntriesResponse)

Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resources (projects, organizations, billing accounts or folders)

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.write
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

MetricsServiceV2

Service for configuring logs-based metrics.

CreateLogMetric

rpc CreateLogMetric(CreateLogMetricRequest) returns (LogMetric)

Creates a logs-based metric.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.write
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

DeleteLogMetric

rpc DeleteLogMetric(DeleteLogMetricRequest) returns (Empty)

Deletes a logs-based metric.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.write
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetLogMetric

rpc GetLogMetric(GetLogMetricRequest) returns (LogMetric)

Gets a logs-based metric.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.read
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListLogMetrics

rpc ListLogMetrics(ListLogMetricsRequest) returns (ListLogMetricsResponse)

Lists logs-based metrics.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.read
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateLogMetric

rpc UpdateLogMetric(UpdateLogMetricRequest) returns (LogMetric)

Creates or updates a logs-based metric.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/logging.write
  • https://www.googleapis.com/auth/logging.admin
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

BigQueryDataset

Describes a BigQuery dataset that was created by a link.

Fields
dataset_id

string

Output only. The full resource name of the BigQuery dataset. The DATASET_ID will match the ID of the link, so the link must match the naming restrictions of BigQuery datasets (alphanumeric characters and underscores only).

The dataset will have a resource path of "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]"

BigQueryOptions

Options that change functionality of a sink exporting data to BigQuery.

Fields
use_partitioned_tables

bool

Optional. Whether to use BigQuery's partition tables. By default, Cloud Logging creates dated tables based on the log entries' timestamps, e.g. syslog_20170523. With partitioned tables the date suffix is no longer present and special query syntax has to be used instead. In both cases, tables are sharded based on UTC timezone.

uses_timestamp_column_partitioning

bool

Output only. True if new timestamp column based partitioning is in use, false if legacy ingestion-time partitioning is in use.

All new sinks will have this field set true and will use timestamp column based partitioning. If use_partitioned_tables is false, this value has no meaning and will be false. Legacy sinks using partitioned tables will have this field set to false.

BucketMetadata

Metadata for LongRunningUpdateBucket Operations.

Fields
start_time

Timestamp

The create time of an operation.

end_time

Timestamp

The end time of an operation.

state

OperationState

State of an operation.

Union field request.

request can be only one of the following:

create_bucket_request

CreateBucketRequest

LongRunningCreateBucket RPC request.

update_bucket_request

UpdateBucketRequest

LongRunningUpdateBucket RPC request.

CmekSettings

Describes the customer-managed encryption key (CMEK) settings associated with a project, folder, organization, billing account, or flexible resource.

Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.

See Enabling CMEK for Log Router for more information.

Fields
name

string

Output only. The resource name of the CMEK settings.

kms_key_name

string

The resource name for the configured Cloud KMS key.

KMS key name format:

"projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"

For example:

"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"

To enable CMEK for the Log Router, set this field to a valid kms_key_name for which the associated service account has the required cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key.

The Cloud KMS key used by the Log Router can be updated by changing the kms_key_name to a new valid key name or disabled by setting the key name to an empty string. Encryption operations that are in progress will be completed with the key that was in use when they started. Decryption operations will be completed using the key that was used at the time of encryption unless access to that key has been revoked.

To disable CMEK for the Log Router, set this field to an empty string.

See Enabling CMEK for Log Router for more information.

kms_key_version_name

string

The CryptoKeyVersion resource name for the configured Cloud KMS key.

KMS key name format:

"projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]"

For example:

"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"

This is a read-only field used to convey the specific configured CryptoKeyVersion of kms_key that has been configured. It will be populated in cases where the CMEK settings are bound to a single key version.

If this field is populated, the kms_key is tied to a specific CryptoKeyVersion.

service_account_id

string

Output only. The service account that will be used by the Log Router to access your Cloud KMS key.

Before enabling CMEK for Log Router, you must first assign the cloudkms.cryptoKeyEncrypterDecrypter role to the service account that the Log Router will use to access your Cloud KMS key. Use GetCmekSettings to obtain the service account ID.

See Enabling CMEK for Log Router for more information.

CopyLogEntriesMetadata

Metadata for CopyLogEntries long running operations.

Fields
start_time

Timestamp

The create time of an operation.

end_time

Timestamp

The end time of an operation.

state

OperationState

State of an operation.

cancellation_requested

bool

Identifies whether the user has requested cancellation of the operation.

request

CopyLogEntriesRequest

CopyLogEntries RPC request.

progress

int32

Estimated progress of the operation (0 - 100%).

writer_identity

string

The IAM identity of a service account that must be granted access to the destination.

If the service account is not granted permission to the destination within an hour, the operation will be cancelled.

For example: "serviceAccount:foo@bar.com"

CopyLogEntriesRequest

The parameters to CopyLogEntries.

Fields
name

string

Required. Log bucket from which to copy log entries.

For example:

"projects/my-project/locations/global/buckets/my-source-bucket"

Authorization requires the following IAM permission on the specified resource name:

  • logging.buckets.copyLogEntries
filter

string

Optional. A filter specifying which log entries to copy. The filter must be no more than 20k characters. An empty filter matches all log entries.

destination

string

Required. Destination to which to copy log entries.

CopyLogEntriesResponse

Response type for CopyLogEntries long running operations.

Fields
log_entries_copied_count

int64

Number of log entries copied.

CreateBucketRequest

The parameters to CreateBucket.

Fields
parent

string

Required. The resource in which to create the log bucket:

"projects/[PROJECT_ID]/locations/[LOCATION_ID]"

For example:

"projects/my-project/locations/global"

Authorization requires the following IAM permission on the specified resource parent:

  • logging.buckets.create
bucket_id

string

Required. A client-assigned identifier such as "my-bucket". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.

bucket

LogBucket

Required. The new bucket. The region specified in the new bucket must be compliant with any Location Restriction Org Policy. The name field in the bucket is ignored.

CreateExclusionRequest

The parameters to CreateExclusion.

Fields
parent

string

Required. The parent resource in which to create the exclusion:

"projects/[PROJECT_ID]"
"organizations/[ORGANIZATION_ID]"
"billingAccounts/[BILLING_ACCOUNT_ID]"
"folders/[FOLDER_ID]"

For examples:

"projects/my-logging-project" "organizations/123456789"

Authorization requires the following IAM permission on the specified resource parent:

  • logging.exclusions.create
exclusion

LogExclusion

Required. The new exclusion, whose name parameter is an exclusion name that is not already used in the parent resource.

CreateLinkRequest

The parameters to CreateLink.

Fields
parent

string

Required. The full resource name of the bucket to create a link for.

"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"

Authorization requires the following IAM permission on the specified resource parent:

  • logging.links.create

CreateLogMetricRequest

The parameters to CreateLogMetric.

Fields
parent

string

Required. The resource name of the project in which to create the metric:

"projects/[PROJECT_ID]"

The new metric must be provided in the request.

Authorization requires the following IAM permission on the specified resource parent:

  • logging.logMetrics.create
metric

LogMetric

Required. The new logs-based metric, which must not have an identifier that already exists.

CreateSinkRequest

The parameters to CreateSink.

Fields
parent

string

Required. The resource in which to create the sink:

"projects/[PROJECT_ID]"
"organizations/[ORGANIZATION_ID]"
"billingAccounts/[BILLING_ACCOUNT_ID]"
"folders/[FOLDER_ID]"

For examples:

"projects/my-project" "organizations/123456789"

Authorization requires the following IAM permission on the specified resource parent:

  • logging.sinks.create
sink

LogSink

Required. The new sink, whose name parameter is a sink identifier that is not already in use.

unique_writer_identity

bool

Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Cloud Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.

If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink.

custom_writer_identity

string

Optional. A service account provided by the caller that will be used to write the log entries. The format must be serviceAccount:some@email. This field can only be specified if you are routing logs to a destination outside this sink's project. If not specified, a Logging service account will automatically be generated.

CreateViewRequest

The parameters to CreateView.

Fields
parent

string

Required. The bucket in which to create the view

`"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"`

For example:

"projects/my-project/locations/global/buckets/my-bucket"

Authorization requires the following IAM permission on the specified resource parent:

  • logging.views.create
view_id

string

Required. A client-assigned identifier such as "my-view". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods.

view

LogView

Required. The new view.

DeleteBucketRequest

The parameters to DeleteBucket.

Fields
name

string

Required. The full resource name of the bucket to delete.

"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"

For example:

"projects/my-project/locations/global/buckets/my-bucket"

Authorization requires the following IAM permission on the specified resource name:

  • logging.buckets.delete

DeleteExclusionRequest

The parameters to DeleteExclusion.

Fields
name

string

Required. The resource name of an existing exclusion to delete:

"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"

For example:

"projects/my-project/exclusions/my-exclusion"

Authorization requires the following IAM permission on the specified resource name:

  • logging.exclusions.delete

DeleteLinkRequest

The parameters to DeleteLink.

Fields
name

string

Required. The full resource name of the link to delete.

"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"

Authorization requires the following IAM permission on the specified resource name:

  • logging.links.delete

DeleteLogMetricRequest

The parameters to DeleteLogMetric.

Fields
metric_name

string

Required. The resource name of the metric to delete:

"projects/[PROJECT_ID]/metrics/[METRIC_ID]"

Authorization requires the following IAM permission on the specified resource metricName:

  • logging.logMetrics.delete

DeleteLogRequest

The parameters to DeleteLog.

Fields
log_name

string

Required. The resource name of the log to delete:

  • projects/[PROJECT_ID]/logs/[LOG_ID]
  • organizations/[ORGANIZATION_ID]/logs/[LOG_ID]
  • billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]
  • folders/[FOLDER_ID]/logs/[LOG_ID]

[LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".

For more information about log names, see LogEntry.

Authorization requires the following IAM permission on the specified resource logName:

  • logging.logs.delete

DeleteSinkRequest

The parameters to DeleteSink.

Fields
sink_name

string

Required. The full resource name of the sink to delete, including the parent resource and the sink identifier:

"projects/[PROJECT_ID]/sinks/[SINK_ID]"
"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
"folders/[FOLDER_ID]/sinks/[SINK_ID]"

For example:

"projects/my-project/sinks/my-sink"

Authorization requires the following IAM permission on the specified resource sinkName:

  • logging.sinks.delete

DeleteViewRequest

The parameters to DeleteView.

Fields
name

string

Required. The full resource name of the view to delete:

"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"

For example:

"projects/my-project/locations/global/buckets/my-bucket/views/my-view"

Authorization requires the following IAM permission on the specified resource name:

  • logging.views.delete

GetBucketRequest

The parameters to GetBucket.

Fields
name

string

Required. The resource name of the bucket:

"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
"folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"

For example:

"projects/my-project/locations/global/buckets/my-bucket"

Authorization requires the following IAM permission on the specified resource name:

  • logging.buckets.get

GetCmekSettingsRequest

The parameters to GetCmekSettings.

See Enabling CMEK for Log Router for more information.

Fields
name

string

Required. The resource for which to retrieve CMEK settings.

"projects/[PROJECT_ID]/cmekSettings"
"organizations/[ORGANIZATION_ID]/cmekSettings"
"billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
"folders/[FOLDER_ID]/cmekSettings"

For example:

"organizations/12345/cmekSettings"

Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.

Authorization requires the following IAM permission on the specified resource name:

  • logging.cmekSettings.get

GetExclusionRequest

The parameters to GetExclusion.

Fields
name

string

Required. The resource name of an existing exclusion:

"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
"organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
"billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
"folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"

For example:

"projects/my-project/exclusions/my-exclusion"

Authorization requires the following IAM permission on the specified resource name:

  • logging.exclusions.get

GetLinkRequest

The parameters to GetLink.

Fields
name

string

Required. The resource name of the link:

"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]

Authorization requires the following IAM permission on the specified resource name:

  • logging.links.get

GetLogMetricRequest

The parameters to GetLogMetric.

Fields
metric_name

string

Required. The resource name of the desired metric:

"projects/[PROJECT_ID]/metrics/[METRIC_ID]"

Authorization requires the following IAM permission on the specified resource metricName:

  • logging.logMetrics.get

GetSettingsRequest

The parameters to GetSettings.

See Enabling CMEK for Log Router for more information.

Fields
name

string

Required. The resource for which to retrieve settings.

"projects/[PROJECT_ID]/settings"
"organizations/[ORGANIZATION_ID]/settings"
"billingAccounts/[BILLING_ACCOUNT_ID]/settings"
"folders/[FOLDER_ID]/settings"

For example:

"organizations/12345/settings"

Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization.

Authorization requires the following IAM permission on the specified resource name:

  • logging.cmekSettings.get

GetSinkRequest

The parameters to GetSink.

Fields
sink_name

string

Required. The resource name of the sink:

"projects/[PROJECT_ID]/sinks/[SINK_ID]"
"organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
"billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
"folders/[FOLDER_ID]/sinks/[SINK_ID]"

For example:

"projects/my-project/sinks/my-sink"

Authorization requires the following IAM permission on the specified resource sinkName:

  • logging.sinks.get

GetViewRequest

The parameters to GetView.

Fields
name

string

Required. The resource name of the policy:

"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"

For example:

"projects/my-project/locations/global/buckets/my-bucket/views/my-view"

Authorization requires the following IAM permission on the specified resource name:

  • logging.views.get

IndexConfig

Configuration for an indexed field.

Fields
field_path

string

Required. The LogEntry field path to index.

Note that some paths are automatically indexed, and other paths are not eligible for indexing. See [indexing documentation]( https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields) for details.

For example: jsonPayload.request.status

type

IndexType

Required. The type of data in this index.

create_time

Timestamp

Output only. The timestamp when the index was last modified.

This is used to return the timestamp, and will be ignored if supplied during update.

IndexType

IndexType is used for custom indexing. It describes the type of an indexed field.

Enums
INDEX_TYPE_UNSPECIFIED The index's type is unspecified.
INDEX_TYPE_STRING The index is a string-type index.
INDEX_TYPE_INTEGER The index is a integer-type index.

LifecycleState

LogBucket lifecycle states.

Enums
LIFECYCLE_STATE_UNSPECIFIED Unspecified state. This is only used/useful for distinguishing unset values.
ACTIVE The normal and active state.
DELETE_REQUESTED The resource has been marked for deletion by the user. For some resources (e.g. buckets), this can be reversed by an un-delete operation.
UPDATING The resource has been marked for an update by the user. It will remain in this state until the update is complete.
CREATING The resource has been marked for creation by the user. It will remain in this state until the creation is complete.
FAILED The resource is in an INTERNAL error state.

LinkMetadata

Metadata for long running Link operations.

Fields
start_time

Timestamp

The start time of an operation.

end_time

Timestamp

The end time of an operation.

state

OperationState

State of an operation.

Union field request.

request can be only one of the following:

ListBucketsRequest

The parameters to ListBuckets.

Fields
parent

string

Required. The parent resource whose buckets are to be listed:

"projects/[PROJECT_ID]/locations/[LOCATION_ID]"
"organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
"billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
"folders/[FOLDER_ID]/locations/[LOCATION_ID]"

Note: The locations portion of the resource must be specified, but supplying the character - in place of [LOCATION_ID] will return all buckets.

Authorization requires the following IAM permission on the specified resource parent:

  • logging.buckets.list
page_token

string

Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.

page_size

int32

Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.

ListBucketsResponse

The response from ListBuckets.

Fields
buckets[]

LogBucket

A list of buckets.

next_page_token

string

If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call the same method again using the value of nextPageToken as pageToken.

ListExclusionsRequest

The parameters to ListExclusions.

Fields
parent

string

Required. The parent resource whose exclusions are to be listed.

"projects/[PROJECT_ID]"
"organizations/[ORGANIZATION_ID]"
"billingAccounts/[BILLING_ACCOUNT_ID]"
"folders/[FOLDER_ID]"

Authorization requires the following IAM permission on the specified resource parent:

  • logging.exclusions.list
page_token

string

Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.

page_size

int32

Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.

ListExclusionsResponse

Result returned from ListExclusions.

Fields
exclusions[]

LogExclusion

A list of exclusions.

next_page_token

string

If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call the same method again using the value of nextPageToken as pageToken.

ListLinksRequest

The parameters to ListLinks.

Fields
parent

string

Required. The parent resource whose links are to be listed:

"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/

Authorization requires the following IAM permission on the specified resource parent:

  • logging.links.list
page_token

string

Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response.

page_size

int32

Optional. The maximum number of results to return from this request.

ListLinksResponse

The response from ListLinks.

Fields
next_page_token

string

If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call the same method again using the value of nextPageToken as pageToken.

ListLogEntriesRequest

The parameters to ListLogEntries.

Fields
project_ids[]
(deprecated)

string

Optional. Deprecated. Use resource_names instead. One or more project identifiers or project numbers from which to retrieve log entries. Example: "my-project-1A".

resource_names[]

string

Required. Names of one or more parent resources from which to retrieve log entries:

  • projects/[PROJECT_ID]
  • organizations/[ORGANIZATION_ID]
  • billingAccounts/[BILLING_ACCOUNT_ID]
  • folders/[FOLDER_ID]

May alternatively be one or more views:

  • projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
  • organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
  • billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
  • folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]

Projects listed in the project_ids field are added to this list. A maximum of 100 resources may be specified in a single request.

Authorization requires one or more of the following IAM permissions on the specified resource resourceNames:

  • logging.logEntries.list
  • logging.privateLogEntries.list
  • logging.views.access
filter

string

Optional. A filter that chooses which log entries to return. For more information, see Logging query language.

Only log entries that match the filter are returned. An empty filter matches all log entries in the resources listed in resource_names. Referencing a parent resource that is not listed in resource_names will cause the filter to return no results. The maximum length of a filter is 20,000 characters.

order_by

string

Optional. How the results should be sorted. Presently, the only permitted values are "timestamp asc" (default) and "timestamp desc". The first option returns entries in order of increasing values of LogEntry.timestamp (oldest first), and the second option returns entries in order of decreasing timestamps (newest first). Entries with equal timestamps are returned in order of their insert_id values.

page_size

int32

Optional. The maximum number of results to return from this request. Default is 50. If the value is negative or exceeds 1000, the request is rejected. The presence of next_page_token in the response indicates that more results might be available.

page_token

string

Optional. If present, then retrieve the next batch of results from the preceding call to this method. page_token must be the value of next_page_token from the previous response. The values of other method parameters should be identical to those in the previous call.

ListLogEntriesResponse

Result returned from ListLogEntries.

Fields
entries[]

LogEntry

A list of log entries. If entries is empty, nextPageToken may still be returned, indicating that more entries may exist. See nextPageToken for more information.

next_page_token

string

If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.

If a value for next_page_token appears and the entries field is empty, it means that the search found no log entries so far but it did not have time to search all the possible log entries. Retry the method with this value for page_token to continue the search. Alternatively, consider speeding up the search by changing your filter to specify a single log name or resource type, or to narrow the time range of the search.

ListLogMetricsRequest

The parameters to ListLogMetrics.

Fields
parent

string

Required. The name of the project containing the metrics:

"projects/[PROJECT_ID]"

Authorization requires the following IAM permission on the specified resource parent:

  • logging.logMetrics.list
page_token

string

Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.

page_size

int32

Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.

ListLogMetricsResponse

Result returned from ListLogMetrics.

Fields
metrics[]

LogMetric

A list of logs-based metrics.

next_page_token

string

If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.

ListLogsRequest

The parameters to ListLogs.

Fields
parent

string

Required. The resource name to list logs for:

  • projects/[PROJECT_ID]
  • organizations/[ORGANIZATION_ID]
  • billingAccounts/[BILLING_ACCOUNT_ID]
  • folders/[FOLDER_ID]

Authorization requires the following IAM permission on the specified resource parent:

  • logging.logs.list
resource_names[]

string

Optional. List of resource names to list logs for:

  • projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
  • organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
  • billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
  • folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]

To support legacy queries, it could also be:

  • projects/[PROJECT_ID]
  • organizations/[ORGANIZATION_ID]
  • billingAccounts/[BILLING_ACCOUNT_ID]
  • folders/[FOLDER_ID]

The resource name in the parent field is added to this list.

Authorization requires the following IAM permission on the specified resource resourceNames:

  • logging.logs.list
page_size

int32

Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.

page_token

string

Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.

ListLogsResponse

Result returned from ListLogs.

Fields
log_names[]

string

A list of log names. For example, "projects/my-project/logs/syslog" or "organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity".

next_page_token

string

If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.