public final class LogSink extends GeneratedMessageV3 implements LogSinkOrBuilder
Describes a sink used to export log entries to one of the following destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a Cloud Pub/Sub topic. A logs filter controls which log entries are exported. The sink must be created within a project, organization, billing account, or folder.Protobuf type
google.logging.v2.LogSink| Modifier and Type | Class and Description |
|---|---|
static class |
LogSink.Builder
Describes a sink used to export log entries to one of the following
destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a
Cloud Pub/Sub topic.
|
static class |
LogSink.VersionFormat
Available log entry formats.
|
GeneratedMessageV3.BuilderParent, GeneratedMessageV3.ExtendableBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage,BuilderType extends GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageV3.ExtendableMessage<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.FieldAccessorTable| Modifier and Type | Field and Description |
|---|---|
static int |
DESTINATION_FIELD_NUMBER |
static int |
END_TIME_FIELD_NUMBER |
static int |
FILTER_FIELD_NUMBER |
static int |
INCLUDE_CHILDREN_FIELD_NUMBER |
static int |
NAME_FIELD_NUMBER |
static int |
OUTPUT_VERSION_FORMAT_FIELD_NUMBER |
static int |
START_TIME_FIELD_NUMBER |
static int |
WRITER_IDENTITY_FIELD_NUMBER |
alwaysUseFieldBuilders, unknownFieldsmemoizedSizememoizedHashCodecanUseUnsafe, computeStringSize, computeStringSizeNoTag, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, makeExtensionsImmutable, newBuilderForType, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitfindInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneoftoByteArray, toByteString, writeDelimitedTo, writeTopublic static final int NAME_FIELD_NUMBER
public static final int DESTINATION_FIELD_NUMBER
public static final int FILTER_FIELD_NUMBER
public static final int OUTPUT_VERSION_FORMAT_FIELD_NUMBER
public static final int WRITER_IDENTITY_FIELD_NUMBER
public static final int INCLUDE_CHILDREN_FIELD_NUMBER
public static final int START_TIME_FIELD_NUMBER
public static final int END_TIME_FIELD_NUMBER
public final UnknownFieldSet getUnknownFields()
getUnknownFields in interface MessageOrBuildergetUnknownFields in class GeneratedMessageV3public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class GeneratedMessageV3public java.lang.String getName()
Required. The client-assigned sink identifier, unique within the project. 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, and periods.
string name = 1;getName in interface LogSinkOrBuilderpublic ByteString getNameBytes()
Required. The client-assigned sink identifier, unique within the project. 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, and periods.
string name = 1;getNameBytes in interface LogSinkOrBuilderpublic java.lang.String getDestination()
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]"
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](/logging/docs/api/tasks/exporting-logs).
string destination = 3;getDestination in interface LogSinkOrBuilderpublic ByteString getDestinationBytes()
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]"
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](/logging/docs/api/tasks/exporting-logs).
string destination = 3;getDestinationBytes in interface LogSinkOrBuilderpublic java.lang.String getFilter()
Optional.
An [advanced logs filter](/logging/docs/view/advanced_filters). 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
string filter = 5;getFilter in interface LogSinkOrBuilderpublic ByteString getFilterBytes()
Optional.
An [advanced logs filter](/logging/docs/view/advanced_filters). 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
string filter = 5;getFilterBytes in interface LogSinkOrBuilderpublic int getOutputVersionFormatValue()
Deprecated. The log entry format to use for this sink's exported log entries. The v2 format is used by default and cannot be changed.
.google.logging.v2.LogSink.VersionFormat output_version_format = 6;getOutputVersionFormatValue in interface LogSinkOrBuilderpublic LogSink.VersionFormat getOutputVersionFormat()
Deprecated. The log entry format to use for this sink's exported log entries. The v2 format is used by default and cannot be changed.
.google.logging.v2.LogSink.VersionFormat output_version_format = 6;getOutputVersionFormat in interface LogSinkOrBuilderpublic java.lang.String getWriterIdentity()
Output only. An IAM identity—a service account or group—under which Stackdriver Logging writes the exported log entries to the sink's destination. This field is set by [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create) and [sinks.update](/logging/docs/api/reference/rest/v2/projects.sinks/update), based on the setting 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](/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource). Consult the destination service's documentation to determine the appropriate IAM roles to assign to the identity.
string writer_identity = 8;getWriterIdentity in interface LogSinkOrBuilderpublic ByteString getWriterIdentityBytes()
Output only. An IAM identity—a service account or group—under which Stackdriver Logging writes the exported log entries to the sink's destination. This field is set by [sinks.create](/logging/docs/api/reference/rest/v2/projects.sinks/create) and [sinks.update](/logging/docs/api/reference/rest/v2/projects.sinks/update), based on the setting 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](/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource). Consult the destination service's documentation to determine the appropriate IAM roles to assign to the identity.
string writer_identity = 8;getWriterIdentityBytes in interface LogSinkOrBuilderpublic boolean getIncludeChildren()
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
logs 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
bool include_children = 9;getIncludeChildren in interface LogSinkOrBuilderpublic boolean hasStartTime()
Deprecated. This field is ignored when creating or updating sinks.
.google.protobuf.Timestamp start_time = 10;hasStartTime in interface LogSinkOrBuilderpublic Timestamp getStartTime()
Deprecated. This field is ignored when creating or updating sinks.
.google.protobuf.Timestamp start_time = 10;getStartTime in interface LogSinkOrBuilderpublic TimestampOrBuilder getStartTimeOrBuilder()
Deprecated. This field is ignored when creating or updating sinks.
.google.protobuf.Timestamp start_time = 10;getStartTimeOrBuilder in interface LogSinkOrBuilderpublic boolean hasEndTime()
Deprecated. This field is ignored when creating or updating sinks.
.google.protobuf.Timestamp end_time = 11;hasEndTime in interface LogSinkOrBuilderpublic Timestamp getEndTime()
Deprecated. This field is ignored when creating or updating sinks.
.google.protobuf.Timestamp end_time = 11;getEndTime in interface LogSinkOrBuilderpublic TimestampOrBuilder getEndTimeOrBuilder()
Deprecated. This field is ignored when creating or updating sinks.
.google.protobuf.Timestamp end_time = 11;getEndTimeOrBuilder in interface LogSinkOrBuilderpublic final boolean isInitialized()
isInitialized in interface MessageLiteOrBuilderisInitialized in class GeneratedMessageV3public void writeTo(CodedOutputStream output) throws java.io.IOException
writeTo in interface MessageLitewriteTo in class GeneratedMessageV3java.io.IOExceptionpublic int getSerializedSize()
getSerializedSize in interface MessageLitegetSerializedSize in class GeneratedMessageV3public boolean equals(java.lang.Object obj)
equals in interface Messageequals in class AbstractMessagepublic int hashCode()
hashCode in interface MessagehashCode in class AbstractMessagepublic static LogSink parseFrom(java.nio.ByteBuffer data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static LogSink parseFrom(java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static LogSink parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static LogSink parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static LogSink parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static LogSink parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static LogSink parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static LogSink parseFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static LogSink parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static LogSink parseDelimitedFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static LogSink parseFrom(CodedInputStream input) throws java.io.IOException
java.io.IOExceptionpublic static LogSink parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic LogSink.Builder newBuilderForType()
newBuilderForType in interface MessagenewBuilderForType in interface MessageLitepublic static LogSink.Builder newBuilder()
public static LogSink.Builder newBuilder(LogSink prototype)
public LogSink.Builder toBuilder()
toBuilder in interface MessagetoBuilder in interface MessageLiteprotected LogSink.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class GeneratedMessageV3public static LogSink getDefaultInstance()
public Parser<LogSink> getParserForType()
getParserForType in interface MessagegetParserForType in interface MessageLitegetParserForType in class GeneratedMessageV3public LogSink getDefaultInstanceForType()
getDefaultInstanceForType in interface MessageLiteOrBuildergetDefaultInstanceForType in interface MessageOrBuilder