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.

CreateLogScope

rpc CreateLogScope(CreateLogScopeRequest) returns (LogScope)

Creates a log scope.

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.

CreateSavedQuery

rpc CreateSavedQuery(CreateSavedQueryRequest) returns (SavedQuery)

Creates a new SavedQuery for the user making the request.

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 begins upon ingress, 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.

DeleteLogScope

rpc DeleteLogScope(DeleteLogScopeRequest) returns (Empty)

Deletes a log scope.

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.

DeleteSavedQuery

rpc DeleteSavedQuery(DeleteSavedQueryRequest) returns (Empty)

Deletes an existing SavedQuery that was created by the user making the request.

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.

GetLogScope

rpc GetLogScope(GetLogScopeRequest) returns (LogScope)

Gets a log scope.

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.

GetSavedQuery

rpc GetSavedQuery(GetSavedQueryRequest) returns (SavedQuery)

Returns all data associated with the requested query.

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 settings for the given resource.

Note: Settings can be retrieved for Google Cloud projects, folders, organizations, and billing accounts.

See View default resource settings for Logging 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.

ListLogScopes

rpc ListLogScopes(ListLogScopesRequest) returns (ListLogScopesResponse)

Lists log scopes.

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.

ListRecentQueries

rpc ListRecentQueries(ListRecentQueriesRequest) returns (ListRecentQueriesResponse)

Lists the RecentQueries that were created by the user making the request.

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.

ListSavedQueries

rpc ListSavedQueries(ListSavedQueriesRequest) returns (ListSavedQueriesResponse)

Lists the SavedQueries that were created by the user making the request.

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 fails when any of the following are true:

  • The value of kms_key_name is invalid.
  • The associated service account doesn't have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key.
  • 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.

UpdateLogScope

rpc UpdateLogScope(UpdateLogScopeRequest) returns (LogScope)

Updates a log scope.

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.

UpdateSavedQuery

rpc UpdateSavedQuery(UpdateSavedQueryRequest) returns (SavedQuery)

Updates an existing SavedQuery.

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 settings for the given resource. This method applies to all feature configurations for organization and folders.

UpdateSettings fails when any of the following are true:

  • The value of storage_location either isn't supported by Logging or violates the location OrgPolicy.
  • The default_sink_config field is set, but it has an unspecified filter write mode.
  • The value of kms_key_name is invalid.
  • The associated service account doesn't have the required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key.
  • Access to the key is disabled.

See Configure default settings for organizations and folders 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 values of the destination and filter fields of the existing sink with the corresponding values from the new sink.

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 value of the filter field from the existing view with the corresponding value from the new view. 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 storing 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 received. 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 resource names (projects, organizations, billing accounts or folders), where the resource name for a log entry is determined from its logName field.

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.

RoutingConfigService

Currently, the RoutingConfigService provides endpoints for routing destinations for log analytic buckets and metric buckets, as well as creating, getting, updating, and deleting metric buckets and the corresponding metric links.

Destinations returned from this API can be treated as canonical. Before the results are returned, permissions for the route are evaluated. Any routes with invalid permissions are dropped from the results.

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 ingress-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

Output only. 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

Optional. 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 needed 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

Output only. 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

Output only. State of an operation.

cancellation_requested

bool

Identifies whether the user has requested cancellation of the operation.

request
(deprecated)

CopyLogEntriesRequest

CopyLogEntries RPC request. This field is deprecated and not used.

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:[email protected]"

source

string

Source from which to copy log entries.

For example, a log bucket:

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

destination

string

Destination to which to copy log entries.

For example, a Cloud Storage bucket:

"storage.googleapis.com/my-cloud-storage-bucket"

verb

string

Name of the verb executed by the operation.

For example,

"copy"

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 identifiers must start with an alphanumeric character.

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.

CreateLogScopeRequest

The parameters to CreateLogScope.

Fields
parent

string

Required. The parent project in which to create the log scope

"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.logScopes.create
log_scope_id

string

Required. A client-assigned identifier such as "log-scope". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. First character has to be alphanumeric.

log_scope

LogScope

Required. The new log scope.

CreateSavedQueryRequest

The parameters to 'CreateSavedQuery'.

Fields
parent

string

Required. The parent resource in which to create the saved query:

"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]"

For example:

"projects/my-project/locations/global"
"organizations/123456789/locations/us-central1"

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

  • logging.queries.create
saved_query_id

string

Optional. The ID to use for the saved query, which will become the final component of the saved query's resource name.

If the saved_query_id is not provided, the system will generate an alphanumeric ID.

The saved_query_id is limited to 100 characters and can include only the following characters:

  • upper and lower-case alphanumeric characters,
  • underscores,
  • hyphens,
  • periods.

First character has to be alphanumeric.

saved_query

SavedQuery

Required. The new saved query.

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 service agent used by the sinks with the same parent. For more information, see writer_identity in LogSink.

custom_writer_identity

string

Optional. The 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 when you are routing logs to a log bucket that is in a different project than the sink. When 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

DeleteLogScopeRequest

The parameters to DeleteLogScope. The _Default log scope cannot be deleted.

Fields
name

string

Required. The resource name of the log scope to delete:

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

For example:

"projects/my-project/locations/global/logScopes/my-log-scope"

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

  • logging.logScopes.delete

DeleteSavedQueryRequest

The parameters to 'DeleteSavedQuery'.

Fields
name

string

Required. The full resource name of the saved query to delete.

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

For example:

"projects/my-project/locations/global/savedQueries/my-saved-query"

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

  • logging.queries.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

GetLogScopeRequest

The parameters to GetLogScope.

Fields
name

string

Required. The resource name of the log scope:

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

For example:

"projects/my-project/locations/global/logScopes/my-log-scope"

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

  • logging.logScopes.get

GetSavedQueryRequest

The parameters to 'GetSavedQuery'

Fields
name

string

Required. The resource name of the saved query.

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

For example:

"projects/my-project/locations/global/savedQueries/my-saved-query"

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

  • logging.queries.get

GetSettingsRequest

The parameters to GetSettings.

See View default resource settings for Logging 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 can be retrieved for Google Cloud projects, folders, organizations, and billing accounts.

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

  • logging.settings.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/analyze/custom-index) 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

Output only. 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]"
"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. Resources may either be resource containers or specific LogViews. For the case of resource containers, all logs ingested into that container will be returned regardless of which LogBuckets they are actually stored in - i.e. these queries may fan out to multiple regions. In the event of region unavailability, specify a specific set of LogViews that do not include the unavailable region.

  • projects/[PROJECT_ID]
  • organizations/[ORGANIZATION_ID]
  • billingAccounts/[BILLING_ACCOUNT_ID]
  • folders/[FOLDER_ID]
  • 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.

To make queries faster, you can make the filter more selective by using restrictions on indexed fields as well as limit the time range of the query by adding range restrictions on the timestamp field.

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.

We recommend setting the order_by field to "timestamp desc" when listing recently ingested log entries. If not set, the default value of "timestamp asc" may take a long time to fetch matching logs that are only recently ingested.

page_size

int32

Optional. The maximum number of results to return from this request. Default is 50. If the value is negative, 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.

ListLogScopesRequest

The parameters to ListLogScopes.

Fields
parent

string

Required. The parent resource whose log scopes are to be listed:

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

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

  • logging.logScopes.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.

ListLogScopesResponse

The response from ListLogScopes. Every project has a _Default log scope that cannot be modified or deleted.

Fields
log_scopes[]

LogScope

A list of log scopes.

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.

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.

ListMonitoredResourceDescriptorsRequest

The parameters to ListMonitoredResourceDescriptors

Fields
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.

ListMonitoredResourceDescriptorsResponse

Result returned from ListMonitoredResourceDescriptors.

Fields
resource_descriptors[]

MonitoredResourceDescriptor

A list of resource descriptors.

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.

ListRecentQueriesRequest

The parameters to 'ListRecentQueries'.

Fields
parent

string

Required. The resource to which the listed queries belong.

"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]"

For example:

projects/my-project/locations/us-central1

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

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

  • logging.queries.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.

filter

string

Optional. Specifies the type ("Logging" or "OpsAnalytics") of the recent queries to list. The only valid value for this field is one of the two allowable type function calls, which are the following:

  • type("Logging")
  • type("OpsAnalytics")

ListRecentQueriesResponse

The response from ListRecentQueries.

Fields
recent_queries[]

RecentQuery

A list of recent queries.

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.

unreachable[]

string

The unreachable resources. Each resource can be either 1) a saved query if a specific query is unreachable or 2) a location if a specific location is unreachable.

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

For example:

"projects/my-project/locations/global/recentQueries/12345678" "projects/my-project/locations/global"

If there are unreachable resources, the response will first return pages that contain recent queries, and then return pages that contain the unreachable resources.

ListSavedQueriesRequest

The parameters to 'ListSavedQueries'.

Fields
parent

string

Required. The resource to which the listed queries belong.

"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]"

For example:

"projects/my-project/locations/us-central1"

Note: The locations portion of the resource must be specified. To get a list of all saved queries, a wildcard character - can be used for [LOCATION_ID], for example:

"projects/my-project/locations/-"

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

  • logging.queries.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.

filter

string

Optional. Specifies the type ("Logging" or "OpsAnalytics") and the visibility (PRIVATE or SHARED) of the saved queries to list. If provided, the filter must contain either the type function or a visibility token, or both. If both are chosen, they can be placed in any order, but they must be joined by the AND operator or the empty character.

The two supported type function calls are:

  • type("Logging")
  • type("OpsAnalytics")

The two supported visibility tokens are:

  • visibility = PRIVATE
  • visibility = SHARED

For example:

type("Logging") AND visibility = PRIVATE visibility=SHARED type("OpsAnalytics") type("OpsAnalytics)" visibility = PRIVATE visibility = SHARED

ListSavedQueriesResponse

The response from ListSavedQueries.

Fields
saved_queries[]

SavedQuery

A list of saved queries.

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.

unreachable[]

string

The unreachable resources. It can be either 1) a saved query if a specific query is unreachable or 2) a location if a specific location is unreachabe.

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

For example:

"projects/my-project/locations/global/savedQueries/12345678"
"projects/my-project/locations/global"

If there are unreachable resources, the response will first return pages that contain saved queries, and then return pages that contain the unreachable resources.

ListSinksRequest

The parameters to ListSinks.

Fields
parent

string

Required. The parent resource whose sinks 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.sinks.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.

filter

string

Optional. A filter expression to constrain the sinks returned. Today, this only supports the following strings:

  • ''
  • 'in_scope("ALL")',
  • 'in_scope("ANCESTOR")',
  • 'in_scope("DEFAULT")'.

Description of scopes below. ALL: Includes all of the sinks which can be returned in any other scope. ANCESTOR: Includes intercepting sinks owned by ancestor resources. DEFAULT: Includes sinks owned by parent.

When the empty string is provided, then the filter 'in_scope("DEFAULT")' is applied.

ListSinksResponse

Result returned from ListSinks.

Fields
sinks[]

LogSink

A list of sinks.

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.

ListViewsRequest

The parameters to ListViews.

Fields
parent

string

Required. The bucket whose views are to be listed:

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

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

  • logging.views.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.

ListViewsResponse

The response from ListViews.

Fields
views[]

LogView

A list of views.

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.

LocationMetadata

Cloud Logging specific location metadata.

Fields
log_analytics_enabled

bool

Indicates whether or not Log Analytics features are supported in the given location.

LogBucket

Describes a repository in which log entries are stored.

Fields
name

string

Output only. The resource name of the bucket.

For example:

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

For a list of supported locations, see Supported Regions

For the location of global it is unspecified where log entries are actually stored.

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

description

string

Optional. Describes this bucket.

create_time

Timestamp

Output only. The creation timestamp of the bucket. This is not set for any of the default buckets.

update_time

Timestamp

Output only. The last update timestamp of the bucket.

retention_days

int32

Optional. Logs will be retained by default for this amount of time, after which they will automatically be deleted. The minimum retention period is 1 day. If this value is set to zero at bucket creation time, the default time of 30 days will be used.

locked

bool

Optional. Whether the bucket is locked.

The retention period on a locked bucket cannot be changed. Locked buckets may only be deleted if they are empty.

lifecycle_state

LifecycleState

Output only. The bucket lifecycle state.

analytics_enabled

bool

Optional. Whether log analytics is enabled for this bucket.

Once enabled, log analytics features cannot be disabled.

restricted_fields[]

string

Optional. Log entry field paths that are denied access in this bucket.

The following fields and their children are eligible: textPayload, jsonPayload, protoPayload, httpRequest, labels, sourceLocation.

Restricting a repeated field will restrict all values. Adding a parent will block all child fields. (e.g. foo.bar will block foo.bar.baz)

index_configs[]

IndexConfig

Optional. A list of indexed fields and related configuration data.

cmek_settings

CmekSettings

Optional. The CMEK settings of the log bucket. If present, new log entries written to this log bucket are encrypted using the CMEK key provided in this configuration. If a log bucket has CMEK settings, the CMEK settings cannot be disabled later by updating the log bucket. Changing the KMS key is allowed.

LogEntry

An individual entry in a log.

Fields
log_name

string

Required. The resource name of the log to which this log entry belongs:

"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]"

A project number may be used in place of PROJECT_ID. The project number is translated to its corresponding PROJECT_ID internally and the log_name field will contain PROJECT_ID in queries and exports.

[LOG_ID] must be URL-encoded within log_name. Example: "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity".

[LOG_ID] must be less than 512 characters long and can only include the following characters: upper and lower case alphanumeric characters, forward-slash, underscore, hyphen, and period.

For backward compatibility, if log_name begins with a forward-slash, such as /projects/..., then the log entry is processed as usual, but the forward-slash is removed. Listing the log entry will not show the leading slash and filtering for a log name with a leading slash will never return any results.

resource

MonitoredResource

Required. The monitored resource that produced this log entry.

Example: a log entry that reports a database error would be associated with the monitored resource designating the particular database that reported the error.

timestamp

Timestamp

Optional. The time the event described by the log entry occurred. This time is used to compute the log entry's age and to enforce the logs retention period. If this field is omitted in a new log entry, then Logging assigns it the current time. Timestamps have nanosecond accuracy, but trailing zeros in the fractional seconds might be omitted when the timestamp is displayed.

Incoming log entries must have timestamps that don't exceed the logs retention period in the past, and that don't exceed 24 hours in the future. Log entries outside those time boundaries are rejected by Logging.

receive_timestamp

Timestamp

Output only. The time the log entry was received by Logging.

severity

LogSeverity

Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT.

insert_id

string

Optional. A unique identifier for the log entry. If you provide a value, then Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which are removed in a single query result. However, there are no guarantees of de-duplication in the export of logs.

If the insert_id is omitted when writing a log entry, the Logging API assigns its own unique identifier in this field.

In queries, the insert_id is also used to order log entries that have the same log_name and timestamp values.

http_request

HttpRequest

Optional. Information about the HTTP request associated with this log entry, if applicable.

labels

map<string, string>

Optional. A map of key, value pairs that provides additional information about the log entry. The labels can be user-defined or system-defined.

User-defined labels are arbitrary key, value pairs that you can use to classify logs.

System-defined labels are defined by GCP services for platform logs. They have two components - a service namespace component and the attribute name. For example: compute.googleapis.com/resource_name.

Cloud Logging truncates label keys that exceed 512 B and label values that exceed 64 KB upon their associated log entry being written. The truncation is indicated by an ellipsis at the end of the character string.

metadata
(deprecated)

MonitoredResourceMetadata

Output only. Deprecated. This field is not used by Logging. Any value written to it is cleared.

operation

LogEntryOperation

Optional. Information about an operation associated with the log entry, if applicable.

trace

string

Optional. The REST resource name of the trace being written to Cloud Trace in association with this log entry. For example, if your trace data is stored in the Cloud project "my-trace-project" and if the service that is creating the log entry receives a trace header that includes the trace ID "12345", then the service should use "projects/my-trace-project/traces/12345".

The trace field provides the link between logs and traces. By using this field, you can navigate from a log entry to a trace.

span_id

string

Optional. The ID of the Cloud Trace span associated with the current operation in which the log is being written. For example, if a span has the REST resource name of "projects/some-project/traces/some-trace/spans/some-span-id", then the span_id field is "some-span-id".

A Span represents a single operation within a trace. Whereas a trace may involve multiple different microservices running on multiple different machines, a span generally corresponds to a single logical operation being performed in a single instance of a microservice on one specific machine. Spans are the nodes within the tree that is a trace.

Applications that are instrumented for tracing will generally assign a new, unique span ID on each incoming request. It is also common to create and record additional spans corresponding to internal processing elements as well as issuing requests to dependencies.

The span ID is expected to be a 16-character, hexadecimal encoding of an 8-byte array and should not be zero. It should be unique within the trace and should, ideally, be generated in a manner that is uniformly random.

Example values:

  • 000000000000004a
  • 7a2190356c3fc94b
  • 0000f00300090021
  • d39223e101960076
trace_sampled

bool

Optional. The sampling decision of the span associated with the log entry at the time the log entry was created. This field corresponds to the sampled flag in the W3C trace-context specification. A non-sampled trace value is still useful as a request correlation identifier. The default is False.

source_location

LogEntrySourceLocation

Optional. Source code location information associated with the log entry, if any.

split

LogSplit

Optional. Information indicating this LogEntry is part of a sequence of multiple log entries split from a single LogEntry.

error_groups[]

LogErrorGroup

Output only. The Error Reporting error groups associated with this LogEntry. Error Reporting sets the values for this field during error group creation.

For more information, see [View error details]( https://cloud.google.com/error-reporting/docs/viewing-errors#view_error_details)

This field isn't available during log routing

Union field payload. The log entry payload, which can be one of multiple types. payload can be only one of the following:
proto_payload

Any

The log entry payload, represented as a protocol buffer. Some Google Cloud Platform services use this field for their log entry payloads.

The following protocol buffer types are supported; user-defined types are not supported:

"type.googleapis.com/google.cloud.audit.AuditLog" "type.googleapis.com/google.appengine.logging.v1.RequestLog"

text_payload

string

The log entry payload, represented as a Unicode string (UTF-8).

json_payload

Struct

The log entry payload, represented as a structure that is expressed as a JSON object.

LogEntryOperation

Additional information about a potentially long-running operation with which a log entry is associated.

Fields
id

string

Optional. An arbitrary operation identifier. Log entries with the same identifier are assumed to be part of the same operation.

producer

string

Optional. An arbitrary producer identifier. The combination of id and producer must be globally unique. Examples for producer: "MyDivision.MyBigCompany.com", "github.com/MyProject/MyApplication".

first

bool

Optional. Set this to True if this is the first log entry in the operation.

last

bool

Optional. Set this to True if this is the last log entry in the operation.

LogEntrySourceLocation

Additional information about the source code location that produced the log entry.

Fields
file

string

Optional. Source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name.

line

int64

Optional. Line within the source file. 1-based; 0 indicates no line number available.

function

string

Optional. Human-readable name of the function or method being invoked, with optional context such as the class or package name. This information may be used in contexts such as the logs viewer, where a file and line number are less meaningful. The format can vary by language. For example: qual.if.ied.Class.method (Java), dir/package.func (Go), function (Python).

LogErrorGroup

Contains metadata that associates the LogEntry to Error Reporting error groups.

Fields
id

string

The id is a unique identifier for a particular error group; it is the last part of the error group resource name: /project/[PROJECT_ID]/errors/[ERROR_GROUP_ID]. Example: COShysOX0r_51QE. The id is derived from key parts of the error-log content and is treated as Service Data. For information about how Service Data is handled, see Google Cloud Privacy Notice.

LogExclusion

Specifies a set of log entries that are filtered out by a sink. If your Google Cloud resource receives a large volume of log entries, you can use exclusions to reduce your chargeable logs. Note that exclusions on organization-level and folder-level sinks don't apply to child resources. Note also that you cannot modify the _Required sink or exclude logs from it.

Fields
name

string

Output only. A client-assigned identifier, such as "load-balancer-exclusion". Identifiers are limited to 100 characters and can include only letters, digits, underscores, hyphens, and periods. First character has to be alphanumeric.

description

string

Optional. A description of this exclusion.

filter

string

Required. An advanced logs filter that matches the log entries to be excluded. By using the sample function, you can exclude less than 100% of the matching log entries.

For example, the following query matches 99% of low-severity log entries from Google Cloud Storage buckets:

resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)

disabled

bool

Optional. If set to True, then this exclusion is disabled and it does not exclude any log entries. You can update an exclusion to change the value of this field.

create_time

Timestamp

Output only. The creation timestamp of the exclusion.

This field may not be present for older exclusions.

update_time

Timestamp

Output only. The last update timestamp of the exclusion.

This field may not be present for older exclusions.

LogMetric

Describes a logs-based metric. The value of the metric is the number of log entries that match a logs filter in a given time interval.

Logs-based metrics can also be used to extract values from logs and create a distribution of the values. The distribution records the statistics of the extracted values along with an optional histogram of the values as specified by the bucket options.

Fields
name

string

Required. The client-assigned metric identifier. Examples: "error_count", "nginx/requests".

Metric identifiers are limited to 100 characters and can include only the following characters: A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.

This field is the [METRIC_ID] part of a metric resource name in the format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the resource name of a metric is "projects/my-project/metrics/nginx%2Frequests", this field's value is "nginx/requests".

resource_name

string

Output only. The resource name of the metric:

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

string

Optional. A description of this metric, which is used in documentation. The maximum length of the description is 8000 characters.

filter

string

Required. An advanced logs filter which is used to match log entries. Example:

"resource.type=gae_app AND severity>=ERROR"

The maximum length of the filter is 20000 characters.

bucket_name

string

Optional. The resource name of the Log Bucket that owns the Log Metric. Only Log Buckets in projects are supported. The bucket has to be in the same project as the metric.

For example:

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

If empty, then the Log Metric is considered a non-Bucket Log Metric.

disabled

bool

Optional. If set to True, then this metric is disabled and it does not generate any points.

metric_descriptor

MetricDescriptor

Optional. The metric descriptor associated with the logs-based metric. If unspecified, it uses a default metric descriptor with a DELTA metric kind, INT64 value type, with no labels and a unit of "1". Such a metric counts the number of log entries matching the filter expression.

The name, type, and description fields in the metric_descriptor are output only, and is constructed using the name and description field in the LogMetric.

To create a logs-based metric that records a distribution of log values, a DELTA metric kind with a DISTRIBUTION value type must be used along with a value_extractor expression in the LogMetric.

Each label in the metric descriptor must have a matching label name as the key and an extractor expression as the value in the label_extractors map.

The metric_kind and value_type fields in the metric_descriptor cannot be updated once initially configured. New labels can be added in the metric_descriptor, but existing labels cannot be modified except for their description.

value_extractor

string

Optional. A value_extractor is required when using a distribution logs-based metric to extract the values to record from a log entry. Two functions are supported for value extraction: EXTRACT(field) or REGEXP_EXTRACT(field, regex). The arguments are:

  1. field: The name of the log entry field from which the value is to be extracted.
  2. regex: A regular expression using the Google RE2 syntax (https://github.com/google/re2/wiki/Syntax) with a single capture group to extract data from the specified log entry field. The value of the field is converted to a string before applying the regex. It is an error to specify a regex that does not include exactly one capture group.

The result of the extraction must be convertible to a double type, as the distribution always records double values. If either the extraction or the conversion to double fails, then those values are not recorded in the distribution.

Example: REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")

label_extractors

map<string, string>

Optional. A map from a label key string to an extractor expression which is used to extract data from a log entry field and assign as the label value. Each label key specified in the LabelDescriptor must have an associated extractor expression in this map. The syntax of the extractor expression is the same as for the value_extractor field.

The extracted value is converted to the type defined in the label descriptor. If either the extraction or the type conversion fails, the label will have a default value. The default value for a string label is an empty string, for an integer label its 0, and for a boolean label its false.

Note that there are upper bounds on the maximum number of labels and the number of active time series that are allowed in a project.

bucket_options

BucketOptions

Optional. The bucket_options are required when the logs-based metric is using a DISTRIBUTION value type and it describes the bucket boundaries used to create a histogram of the extracted values.

create_time

Timestamp

Output only. The creation timestamp of the metric.

This field may not be present for older metrics.

update_time

Timestamp

Output only. The last update timestamp of the metric.

This field may not be present for older metrics.

version
(deprecated)

ApiVersion

Deprecated. The API version that created or updated this metric. The v2 format is used by default and cannot be changed.

ApiVersion

Logging API version.

Enums
V2 Logging API v2.
V1 Logging API v1.

LogScope

Describes a group of resources to read log entries from.

Fields
name

string

Output only. The resource name of the log scope.

Log scopes are only available in the global location. For example:

projects/my-project/locations/global/logScopes/my-log-scope

resource_names[]

string

Required. Names of one or more parent resources:

  • projects/[PROJECT_ID]

May alternatively be one or more views:

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

A log scope can include a maximum of 5 projects and a maximum of 100 resources in total.

description

string

Optional. Describes this log scope.

The maximum length of the description is 8000 characters.

create_time

Timestamp

Output only. The creation timestamp of the log scope.

update_time

Timestamp

Output only. The last update timestamp of the log scope.

LogSink

Describes a sink used to export log entries to one of the following destinations:

  • a Cloud Logging log bucket,
  • a Cloud Storage bucket,
  • a BigQuery dataset,
  • a Pub/Sub topic,
  • a Cloud project.

A logs filter controls which log entries are exported. The sink must be created within a project, organization, billing account, or folder.

Fields
name

string

Output only. The client-assigned sink identifier, unique within the project.

For example: "my-syslog-errors-to-pubsub".

Sink identifiers are limited to 100 characters and can include only the following characters:

  • upper and lower-case alphanumeric characters,
  • underscores,
  • hyphens,
  • periods.

First character has to be alphanumeric.

resource_name

string

Output only. The resource name of the sink.

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

For example: projects/my_project/sinks/SINK_NAME

destination

string

Required. The export destination:

"storage.googleapis.com/[GCS_BUCKET]"
"bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
"pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
"logging.googleapis.com/projects/[PROJECT_ID]"
"logging.googleapis.com/projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"

The sink's writer_identity, set when the sink is created, must have permission to write to the destination or else the log entries are not exported. For more information, see Exporting Logs with Sinks.

filter

string

Optional. An advanced logs filter. The only exported log entries are those that are in the resource owning the sink and that match the filter.

For example:

logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR

description

string

Optional. A description of this sink.

The maximum length of the description is 8000 characters.

disabled

bool

Optional. If set to true, then this sink is disabled and it does not export any log entries.

exclusions[]

LogExclusion

Optional. Log entries that match any of these exclusion filters will not be exported.

If a log entry is matched by both filter and one of exclusion_filters it will not be exported.

output_version_format
(deprecated)

VersionFormat

Deprecated. This field is unused.

writer_identity

string

Output only. An IAM identity—a service account or group—under which Cloud Logging writes the exported log entries to the sink's destination. This field is either set by specifying custom_writer_identity or set automatically by sinks.create and sinks.update based on the value of unique_writer_identity in those methods.

Until you grant this identity write-access to the destination, log entry exports from this sink will fail. For more information, see Granting Access for a Resource. Consult the destination service's documentation to determine the appropriate IAM roles to assign to the identity.

Sinks that have a destination that is a log bucket in the same project as the sink cannot have a writer_identity and no additional permissions are required.

include_children

bool

Optional. This field applies only to sinks owned by organizations and folders. If the field is false, the default, only the logs owned by the sink's parent resource are available for export. If the field is true, then log entries from all the projects, folders, and billing accounts contained in the sink's parent resource are also available for export. Whether a particular log entry from the children is exported depends on the sink's filter expression.

For example, if this field is true, then the filter resource.type=gce_instance would export all Compute Engine VM instance log entries from all projects in the sink's parent.

To only export entries from certain child projects, filter on the project part of the log name:

logName:("projects/test-project1/" OR "projects/test-project2/") AND resource.type=gce_instance

intercept_children

bool

Optional. This field applies only to sinks owned by organizations and folders.

When the value of 'intercept_children' is true, the following restrictions apply:

  • The sink must have the include_children flag set to true.
  • The sink destination must be a Cloud project.

Also, the following behaviors apply:

  • Any logs matched by the sink won't be included by non-_Required sinks owned by child resources.
  • The sink appears in the results of a ListSinks call from a child resource if the value of the filter field in its request is either 'in_scope("ALL")' or 'in_scope("ANCESTOR")'.
create_time

Timestamp

Output only. The creation timestamp of the sink.

This field may not be present for older sinks.

update_time

Timestamp

Output only. The last update timestamp of the sink.

This field may not be present for older sinks.

Union field options. Destination dependent options. options can be only one of the following:
bigquery_options

BigQueryOptions

Optional. Options that affect sinks exporting data to BigQuery.

VersionFormat

Deprecated. This is unused.

Enums
VERSION_FORMAT_UNSPECIFIED An unspecified format version that will default to V2.
V2 LogEntry version 2 format.
V1 LogEntry version 1 format.

LogSplit

Additional information used to correlate multiple log entries. Used when a single LogEntry would exceed the Google Cloud Logging size limit and is split across multiple log entries.

Fields
uid

string

A globally unique identifier for all log entries in a sequence of split log entries. All log entries with the same |LogSplit.uid| are assumed to be part of the same sequence of split log entries.

index

int32

The index of this LogEntry in the sequence of split log entries. Log entries are given |index| values 0, 1, ..., n-1 for a sequence of n log entries.

total_splits

int32

The total number of log entries that the original LogEntry was split into.

LogView

Describes a view over log entries in a bucket.

Fields
name

string

Output only. The resource name of the view.

For example:

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

description

string

Optional. Describes this view.

create_time

Timestamp

Output only. The creation timestamp of the view.

update_time

Timestamp

Output only. The last update timestamp of the view.

filter

string

Optional. Filter that restricts which log entries in a bucket are visible in this view.

Filters must be logical conjunctions that use the AND operator, and they can use any of the following qualifiers:

  • SOURCE(), which specifies a project, folder, organization, or billing account of origin.
  • resource.type, which specifies the resource type.
  • LOG_ID(), which identifies the log.

They can also use the negations of these qualifiers with the NOT operator.

For example:

SOURCE("projects/myproject") AND resource.type = "gce_instance" AND NOT LOG_ID("stdout")

LoggingQuery

Describes a Cloud Logging query that can be run in Logs Explorer UI or via the logging API.

In addition to the query itself, additional information may be stored to capture the display configuration and other UI state used in association with analysis of query results.

Fields
filter

string

Required. An advanced query using the Logging Query Language. The maximum length of the filter is 20000 characters.

summary_fields[]

SummaryField

Optional. The set of summary fields to display for this saved query.

Union field summary_field_width. The user's setting for number of characters to display for each summary field. In the Logs Explorer page of Google Cloud console, negative values are ignored and the default (0) means there is no truncation. summary_field_width can be only one of the following:
summary_field_start

int32

Characters will be counted from the start of the string.

summary_field_end

int32

Characters will be counted from the end of the string.

SummaryField

A field from the LogEntry that is added to the summary line for a query in the Logs Explorer.

Fields
field

string

Optional. The field from the LogEntry to include in the summary line, for example resource.type or jsonPayload.name.

OperationState

List of different operation states. High level state of the operation. This is used to report the job's current state to the user. Once a long running operation is created, the current state of the operation can be queried even before the operation is finished and the final result is available.

Enums
OPERATION_STATE_UNSPECIFIED Should not be used.
OPERATION_STATE_SCHEDULED The operation is scheduled.
OPERATION_STATE_WAITING_FOR_PERMISSIONS Waiting for necessary permissions.
OPERATION_STATE_RUNNING The operation is running.
OPERATION_STATE_SUCCEEDED The operation was completed successfully.
OPERATION_STATE_FAILED The operation failed.
OPERATION_STATE_CANCELLED The operation was cancelled by the user.
OPERATION_STATE_PENDING The operation is waiting for quota.

OpsAnalyticsQuery

Describes an analytics query that can be run in the Log Analytics page of Google Cloud console.

Preview: This is a preview feature and may be subject to change before final release.

Fields
sql_query_text

string

Required. A logs analytics SQL query, which generally follows BigQuery format.

This is the SQL query that appears in the Log Analytics UI's query editor.

RecentQuery

Describes a recent query executed on the Logs Explorer or Log Analytics page within the last ~ 30 days.

Fields
name

string

Output only. Resource name of the recent query.

In the format:

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

For a list of supported locations, see Supported Regions

The [QUERY_ID] is a system generated alphanumeric ID.

last_run_time

Timestamp

Output only. The timestamp when this query was last run.

Union field query_oneof. The query that was executed. query_oneof can be only one of the following:
logging_query

LoggingQuery

Logging query that can be executed in Logs Explorer or via Logging API.

ops_analytics_query

OpsAnalyticsQuery

Analytics query that can be executed in Log Analytics.

SavedQuery

Describes a query that has been saved by a user.

Fields
name

string

Output only. Resource name of the saved query.

In the format:

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

For a list of supported locations, see Supported Regions

After the saved query is created, the location cannot be changed.

If the user doesn't provide a [QUERY_ID], the system will generate an alphanumeric ID.

display_name

string

Required. The user specified title for the SavedQuery.

description

string

Optional. A human readable description of the saved query.

create_time

Timestamp

Output only. The timestamp when the saved query was created.

update_time

Timestamp

Output only. The timestamp when the saved query was last updated.

visibility

Visibility

Required. The visibility status of this query, which determines its ownership.

Union field query_oneof. The query that is saved. query_oneof can be only one of the following:
logging_query

LoggingQuery

Logging query that can be executed in Logs Explorer or via Logging API.

ops_analytics_query

OpsAnalyticsQuery

Analytics query that can be executed in Log Analytics.

Visibility

Saved query visibility.

Enums
VISIBILITY_UNSPECIFIED The saved query visibility is unspecified. A CreateSavedQuery request with an unspecified visibility will be rejected.
PRIVATE The saved query is only visible to the user that created it.
SHARED The saved query is visible to anyone in the project.

Settings

Describes the settings associated with a project, folder, organization, or billing account.

Fields
name

string

Output only. The resource name of the settings.

kms_key_name

string

Optional. 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, set this field to a valid kms_key_name for which the associated service account has the required roles/cloudkms.cryptoKeyEncrypterDecrypter role 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.

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

See Enabling CMEK for Log Router for more information.

kms_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, you must first assign the role roles/cloudkms.cryptoKeyEncrypterDecrypter to the service account that will be used to access your Cloud KMS key. Use GetSettings to obtain the service account ID.

See Enabling CMEK for Log Router for more information.

storage_location

string

Optional. The storage location for the _Default and _Required log buckets of newly created projects and folders, unless the storage location is explicitly provided.

Example value: europe-west1.

Note: this setting does not affect the location of resources where a location is explicitly provided when created, such as custom log buckets.

disable_default_sink

bool

Optional. If set to true, the _Default sink in newly created projects and folders will created in a disabled state. This can be used to automatically disable log storage if there is already an aggregated sink configured in the hierarchy. The _Default sink can be re-enabled manually if needed.

default_sink_config

DefaultSinkConfig

Optional. Overrides the built-in configuration for _Default sink.

logging_service_account_id

string

Output only. The service account for the given resource container, such as project or folder. Log sinks use this service account as their writer_identity if no custom service account is provided in the request when calling the create sink method.

DefaultSinkConfig

Describes the custom _Default sink configuration that is used to override the built-in _Default sink configuration in newly created resource containers, such as projects or folders.

Fields
filter

string

Optional. An advanced logs filter. The only exported log entries are those that are in the resource owning the sink and that match the filter.

For example:

logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR

To match all logs, don't add exclusions and use the following line as the value of filter:

logName:*

Cannot be empty or unset when the value of mode is OVERWRITE.

exclusions[]

LogExclusion

Optional. Specifies the set of exclusions to be added to the _Default sink in newly created resource containers.

mode

FilterWriteMode

Required. Determines the behavior to apply to the built-in _Default sink inclusion filter.

Exclusions are always appended, as built-in _Default sinks have no exclusions.

FilterWriteMode

Behavior to apply to the built-in _Default sink inclusion filter.

Enums
FILTER_WRITE_MODE_UNSPECIFIED The filter's write mode is unspecified. This mode must not be used.
APPEND The contents of filter will be appended to the built-in _Default sink filter. Using the append mode with an empty filter will keep the sink inclusion filter unchanged.
OVERWRITE The contents of filter will overwrite the built-in _Default sink filter.

TailLogEntriesRequest

The parameters to TailLogEntries.

Fields
resource_names[]

string

Required. Name of a parent resource 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]

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

  • logging.logEntries.list
  • logging.privateLogEntries.list
filter

string

Optional. 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.

buffer_window

Duration

Optional. The amount of time to buffer log entries at the server before being returned to prevent out of order results due to late arriving log entries. Valid values are between 0-60000 milliseconds. Defaults to 2000 milliseconds.

TailLogEntriesResponse

Result returned from TailLogEntries.

Fields
entries[]

LogEntry

A list of log entries. Each response in the stream will order entries with increasing values of LogEntry.timestamp. Ordering is not guaranteed between separate responses.

suppression_info[]

SuppressionInfo

If entries that otherwise would have been included in the session were not sent back to the client, counts of relevant entries omitted from the session with the reason that they were not included. There will be at most one of each reason per response. The counts represent the number of suppressed entries since the last streamed response.

SuppressionInfo

Information about entries that were omitted from the session.

Fields
reason

Reason

The reason that entries were omitted from the session.

suppressed_count

int32

A lower bound on the count of entries omitted due to reason.

Reason

An indicator of why entries were omitted.

Enums
REASON_UNSPECIFIED Unexpected default.
RATE_LIMIT Indicates suppression occurred due to relevant entries being received in excess of rate limits. For quotas and limits, see Logging API quotas and limits.
NOT_CONSUMED Indicates suppression occurred due to the client not consuming responses quickly enough.

UndeleteBucketRequest

The parameters to UndeleteBucket.

Fields
name

string

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

"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.undelete

UpdateBucketRequest

The parameters to UpdateBucket.

Fields
name

string

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

"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.update
bucket

LogBucket

Required. The updated bucket.

update_mask

FieldMask

Required. Field mask that specifies the fields in bucket that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.

For a detailed FieldMask definition, see: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask

For example: updateMask=retention_days

UpdateCmekSettingsRequest

The parameters to UpdateCmekSettings.

See Enabling CMEK for Log Router for more information.

Fields
name

string

Required. The resource name for the CMEK settings to update.

"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 currently only be configured for Google Cloud organizations. Once configured, 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
cmek_settings

CmekSettings

Required. The CMEK settings to update.

See Enabling CMEK for Log Router for more information.

update_mask

FieldMask

Optional. Field mask identifying which fields from cmek_settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.

See FieldMask for more information.

For example: "updateMask=kmsKeyName"

UpdateExclusionRequest

The parameters to UpdateExclusion.

Fields
name

string

Required. The resource name of the exclusion to update:

"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.update
exclusion

LogExclusion

Required. New values for the existing exclusion. Only the fields specified in update_mask are relevant.

update_mask

FieldMask

Required. A non-empty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.

For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description".

UpdateLogMetricRequest

The parameters to UpdateLogMetric.

Fields
metric_name

string

Required. The resource name of the metric to update:

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

The updated metric must be provided in the request and it's name field must be the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a new metric is created.

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

  • logging.logMetrics.update
metric

LogMetric

Required. The updated metric.

UpdateLogScopeRequest

The parameters to UpdateLogScope. The _Default log scope cannot be modified.

Fields
log_scope

LogScope

Required. The updated log scope.

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

  • logging.logScopes.update
update_mask

FieldMask

Optional. Field mask that specifies the fields in log_scope that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.

For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask

For example: updateMask=description

UpdateSavedQueryRequest

The parameters to 'UpdateSavedQuery'.

Fields
saved_query

SavedQuery

Required. The updated value for the query.

The saved_query's name field is used to identify the saved query to update. Format:

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

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

  • logging.queries.update
update_mask

FieldMask

Required. A non-empty list of fields to change in the existing saved query. Fields are relative to the saved_query and new values for the fields are taken from the corresponding fields in the SavedQuery included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.

To update all mutable fields, specify an update_mask of *.

For example, to change the description and query filter text of a saved query, specify an update_mask of "description, query.filter".

UpdateSettingsRequest

The parameters to UpdateSettings.

See Configure default settings for organizations and folders for more information.

Fields
name

string

Required. The resource name for the settings to update.

"organizations/[ORGANIZATION_ID]/settings"
"folders/[FOLDER_ID]/settings"

For example:

"organizations/12345/settings"

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

  • logging.settings.update
settings

Settings

Required. The settings to update.

See Enabling CMEK for Log Router for more information.

update_mask

FieldMask

Optional. Field mask identifying which fields from settings should be updated. A field will be overwritten if and only if it is in the update mask. Output only fields cannot be updated.

See FieldMask for more information.

For example: "updateMask=kmsKeyName"

UpdateSinkRequest

The parameters to UpdateSink.

Fields
sink_name

string

Required. The full resource name of the sink to update, 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.update
sink

LogSink

Required. The updated sink, whose name is the same identifier that appears as part of sink_name.

unique_writer_identity

bool

Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field:

  • If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity.
  • If the old value is false and the new value is true, then writer_identity is changed to a service agent owned by Cloud Logging.
  • It is an error if the old value is true and the new value is set to false or defaulted to false.
custom_writer_identity

string

Optional. The 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 when you are routing logs to a log bucket that is in a different project than the sink. When not specified, a Logging service account will automatically be generated.

update_mask

FieldMask

Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.

An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes:

destination,filter,includeChildren

At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.

For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask

For example: updateMask=filter

UpdateViewRequest

The parameters to UpdateView.

Fields
name

string

Required. The full resource name of the view to update

"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.update
view

LogView

Required. The updated view.

update_mask

FieldMask

Optional. Field mask that specifies the fields in view that need an update. A field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.

For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask

For example: updateMask=filter

WriteLogEntriesPartialErrors

Error details for WriteLogEntries with partial success.

Fields
log_entry_errors

map<int32, Status>

When WriteLogEntriesRequest.partial_success is true, records the error status for entries that were not written due to a permanent error, keyed by the entry's zero-based index in WriteLogEntriesRequest.entries.

Failed requests for which no entries are written will not include per-entry errors.

WriteLogEntriesRequest

The parameters to WriteLogEntries.

Fields
log_name

string

Optional. A default log resource name that is assigned to all log entries in entries that do not specify a value for log_name:

  • 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"

The permission logging.logEntries.create is needed on each project, organization, billing account, or folder that is receiving new log entries, whether the resource is specified in logName or in an individual log entry.

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

  • logging.logEntries.create
resource

MonitoredResource

Optional. A default monitored resource object that is assigned to all log entries in entries that do not specify a value for resource. Example:

{ "type": "gce_instance",
  "labels": {
    "zone": "us-central1-a", "instance_id": "00000000000000000000" }}

See LogEntry.

labels

map<string, string>

Optional. Default labels that are added to the labels field of all log entries in entries. If a log entry already has a label with the same key as a label in this parameter, then the log entry's label is not changed. See LogEntry.

entries[]

LogEntry

Required. The log entries to send to Logging. The order of log entries in this list does not matter. Values supplied in this method's log_name, resource, and labels fields are copied into those log entries in this list that do not include values for their corresponding fields. For more information, see the LogEntry type.

If the timestamp or insert_id fields are missing in log entries, then this method supplies the current time or a unique identifier, respectively. The supplied values are chosen so that, among the log entries that did not supply their own values, the entries earlier in the list will sort before the entries later in the list. See the entries.list method.

Log entries with timestamps that are more than the logs retention period in the past or more than 24 hours in the future will not be available when calling entries.list. However, those log entries can still be exported with LogSinks.

To improve throughput and to avoid exceeding the quota limit for calls to entries.write, you should try to include several log entries in this list, rather than calling this method for each individual log entry.

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

  • logging.logEntries.create
partial_success

bool

Optional. Whether a batch's valid entries should be written even if some other entry failed due to a permanent error such as INVALID_ARGUMENT or PERMISSION_DENIED. If any entry failed, then the response status is the response status of one of the failed entries. The response will include error details in WriteLogEntriesPartialErrors.log_entry_errors keyed by the entries' zero-based index in the entries. Failed requests for which no entries are written will not include per-entry errors.

dry_run

bool

Optional. If true, the request should expect normal response, but the entries won't be persisted nor exported. Useful for checking whether the logging API endpoints are working properly before sending valuable data.

WriteLogEntriesResponse

This type has no fields.

Result returned from WriteLogEntries.