public final class LogSink extends com.google.protobuf.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.
|
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.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 |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
static LogSink |
getDefaultInstance() |
LogSink |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
java.lang.String |
getDestination()
Required.
|
com.google.api.resourcenames.ResourceName |
getDestinationAsResourceName() |
com.google.protobuf.ByteString |
getDestinationBytes()
Required.
|
com.google.protobuf.Timestamp |
getEndTime()
Optional.
|
com.google.protobuf.TimestampOrBuilder |
getEndTimeOrBuilder()
Optional.
|
java.lang.String |
getFilter()
Optional.
|
com.google.protobuf.ByteString |
getFilterBytes()
Optional.
|
boolean |
getIncludeChildren()
Optional.
|
java.lang.String |
getName()
Required.
|
com.google.protobuf.ByteString |
getNameBytes()
Required.
|
LogSink.VersionFormat |
getOutputVersionFormat()
Optional.
|
int |
getOutputVersionFormatValue()
Optional.
|
com.google.protobuf.Parser<LogSink> |
getParserForType() |
int |
getSerializedSize() |
com.google.protobuf.Timestamp |
getStartTime()
Optional.
|
com.google.protobuf.TimestampOrBuilder |
getStartTimeOrBuilder()
Optional.
|
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
java.lang.String |
getWriterIdentity()
Output only.
|
com.google.protobuf.ByteString |
getWriterIdentityBytes()
Output only.
|
boolean |
hasEndTime()
Optional.
|
int |
hashCode() |
boolean |
hasStartTime()
Optional.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static LogSink.Builder |
newBuilder() |
static LogSink.Builder |
newBuilder(LogSink prototype) |
LogSink.Builder |
newBuilderForType() |
protected LogSink.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
static LogSink |
parseDelimitedFrom(java.io.InputStream input) |
static LogSink |
parseDelimitedFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static LogSink |
parseFrom(byte[] data) |
static LogSink |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static LogSink |
parseFrom(java.nio.ByteBuffer data) |
static LogSink |
parseFrom(java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static LogSink |
parseFrom(com.google.protobuf.ByteString data) |
static LogSink |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static LogSink |
parseFrom(com.google.protobuf.CodedInputStream input) |
static LogSink |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static LogSink |
parseFrom(java.io.InputStream input) |
static LogSink |
parseFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<LogSink> |
parser() |
LogSink.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
computeStringSize, computeStringSizeNoTag, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, makeExtensionsImmutable, newBuilderForType, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic 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 com.google.protobuf.UnknownFieldSet getUnknownFields()
getUnknownFields in interface com.google.protobuf.MessageOrBuildergetUnknownFields in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.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 com.google.protobuf.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 com.google.protobuf.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. The filter must use the log entry format specified
by the `output_version_format` parameter. For example, in the v2 format:
logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
string filter = 5;getFilter in interface LogSinkOrBuilderpublic com.google.protobuf.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. The filter must use the log entry format specified
by the `output_version_format` parameter. For example, in the v2 format:
logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
string filter = 5;getFilterBytes in interface LogSinkOrBuilderpublic int getOutputVersionFormatValue()
Optional. The log entry format to use for this sink's exported log entries. The v2 format is used by default. **The v1 format is deprecated** and should be used only as part of a migration effort to v2. See [Migration to the v2 API](/logging/docs/api/v2/migration-to-v2).
.google.logging.v2.LogSink.VersionFormat output_version_format = 6;getOutputVersionFormatValue in interface LogSinkOrBuilderpublic LogSink.VersionFormat getOutputVersionFormat()
Optional. The log entry format to use for this sink's exported log entries. The v2 format is used by default. **The v1 format is deprecated** and should be used only as part of a migration effort to v2. See [Migration to the v2 API](/logging/docs/api/v2/migration-to-v2).
.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 com.google.protobuf.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()
Optional. The time at which this sink will begin exporting log entries. Log entries are exported only if their timestamp is not earlier than the start time. The default value of this field is the time the sink is created or updated.
.google.protobuf.Timestamp start_time = 10;hasStartTime in interface LogSinkOrBuilderpublic com.google.protobuf.Timestamp getStartTime()
Optional. The time at which this sink will begin exporting log entries. Log entries are exported only if their timestamp is not earlier than the start time. The default value of this field is the time the sink is created or updated.
.google.protobuf.Timestamp start_time = 10;getStartTime in interface LogSinkOrBuilderpublic com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder()
Optional. The time at which this sink will begin exporting log entries. Log entries are exported only if their timestamp is not earlier than the start time. The default value of this field is the time the sink is created or updated.
.google.protobuf.Timestamp start_time = 10;getStartTimeOrBuilder in interface LogSinkOrBuilderpublic boolean hasEndTime()
Optional. The time at which this sink will stop exporting log entries. Log entries are exported only if their timestamp is earlier than the end time. If this field is not supplied, there is no end time. If both a start time and an end time are provided, then the end time must be later than the start time.
.google.protobuf.Timestamp end_time = 11;hasEndTime in interface LogSinkOrBuilderpublic com.google.protobuf.Timestamp getEndTime()
Optional. The time at which this sink will stop exporting log entries. Log entries are exported only if their timestamp is earlier than the end time. If this field is not supplied, there is no end time. If both a start time and an end time are provided, then the end time must be later than the start time.
.google.protobuf.Timestamp end_time = 11;getEndTime in interface LogSinkOrBuilderpublic com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder()
Optional. The time at which this sink will stop exporting log entries. Log entries are exported only if their timestamp is earlier than the end time. If this field is not supplied, there is no end time. If both a start time and an end time are provided, then the end time must be later than the start time.
.google.protobuf.Timestamp end_time = 11;getEndTimeOrBuilder in interface LogSinkOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3java.io.IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(java.lang.Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static LogSink parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static LogSink parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static LogSink parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static LogSink parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static LogSink parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static LogSink parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static LogSink parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static LogSink parseFrom(java.io.InputStream input, com.google.protobuf.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, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static LogSink parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException
java.io.IOExceptionpublic static LogSink parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic LogSink.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static LogSink.Builder newBuilder()
public static LogSink.Builder newBuilder(LogSink prototype)
public LogSink.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected LogSink.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public final com.google.api.resourcenames.ResourceName getDestinationAsResourceName()
public static LogSink getDefaultInstance()
public static com.google.protobuf.Parser<LogSink> parser()
public com.google.protobuf.Parser<LogSink> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public LogSink getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder