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, unknownFields
memoizedSize
memoizedHashCode
canUseUnsafe, 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, writeStringNoTag
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof
toByteArray, toByteString, writeDelimitedTo, writeTo
public 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 MessageOrBuilder
getUnknownFields
in class GeneratedMessageV3
public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class GeneratedMessageV3
public 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 LogSinkOrBuilder
public 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 LogSinkOrBuilder
public 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 LogSinkOrBuilder
public 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 LogSinkOrBuilder
public 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 LogSinkOrBuilder
public 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 LogSinkOrBuilder
public 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 LogSinkOrBuilder
public 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 LogSinkOrBuilder
public 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 LogSinkOrBuilder
public 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 LogSinkOrBuilder
public 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 LogSinkOrBuilder
public boolean hasStartTime()
Deprecated. This field is ignored when creating or updating sinks.
.google.protobuf.Timestamp start_time = 10;
hasStartTime
in interface LogSinkOrBuilder
public Timestamp getStartTime()
Deprecated. This field is ignored when creating or updating sinks.
.google.protobuf.Timestamp start_time = 10;
getStartTime
in interface LogSinkOrBuilder
public TimestampOrBuilder getStartTimeOrBuilder()
Deprecated. This field is ignored when creating or updating sinks.
.google.protobuf.Timestamp start_time = 10;
getStartTimeOrBuilder
in interface LogSinkOrBuilder
public boolean hasEndTime()
Deprecated. This field is ignored when creating or updating sinks.
.google.protobuf.Timestamp end_time = 11;
hasEndTime
in interface LogSinkOrBuilder
public Timestamp getEndTime()
Deprecated. This field is ignored when creating or updating sinks.
.google.protobuf.Timestamp end_time = 11;
getEndTime
in interface LogSinkOrBuilder
public TimestampOrBuilder getEndTimeOrBuilder()
Deprecated. This field is ignored when creating or updating sinks.
.google.protobuf.Timestamp end_time = 11;
getEndTimeOrBuilder
in interface LogSinkOrBuilder
public final boolean isInitialized()
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessageV3
public void writeTo(CodedOutputStream output) throws java.io.IOException
writeTo
in interface MessageLite
writeTo
in class GeneratedMessageV3
java.io.IOException
public int getSerializedSize()
getSerializedSize
in interface MessageLite
getSerializedSize
in class GeneratedMessageV3
public boolean equals(java.lang.Object obj)
equals
in interface Message
equals
in class AbstractMessage
public int hashCode()
hashCode
in interface Message
hashCode
in class AbstractMessage
public static LogSink parseFrom(java.nio.ByteBuffer data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static LogSink parseFrom(java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static LogSink parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static LogSink parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static LogSink parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static LogSink parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static LogSink parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static LogSink parseFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public static LogSink parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static LogSink parseDelimitedFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public static LogSink parseFrom(CodedInputStream input) throws java.io.IOException
java.io.IOException
public static LogSink parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public LogSink.Builder newBuilderForType()
newBuilderForType
in interface Message
newBuilderForType
in interface MessageLite
public static LogSink.Builder newBuilder()
public static LogSink.Builder newBuilder(LogSink prototype)
public LogSink.Builder toBuilder()
toBuilder
in interface Message
toBuilder
in interface MessageLite
protected LogSink.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
newBuilderForType
in class GeneratedMessageV3
public static LogSink getDefaultInstance()
public Parser<LogSink> getParserForType()
getParserForType
in interface Message
getParserForType
in interface MessageLite
getParserForType
in class GeneratedMessageV3
public LogSink getDefaultInstanceForType()
getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder