Class Sink.Builder (3.5.3)

public static final class Sink.Builder extends SinkInfo.Builder

A builder for Sink objects.

Inheritance

java.lang.Object > SinkInfo.Builder > Sink.Builder

Methods

build()

public Sink build()

Creates a SinkInfo object for this builder.

Returns
TypeDescription
Sink
Overrides

setDestination(SinkInfo.Destination destination)

public Sink.Builder setDestination(SinkInfo.Destination destination)

Sets the export destination. Use a Destination.BucketDestination object to create a sink that exports logs to a Google Cloud Storage bucket. Use a Destination.DatasetDestination object to create a sink that exports logs to a Google Cloud BigQuery dataset. Use a Destination.TopicDestination object to create a sink that exports logs to a Google Cloud Pub/Sub topic.

Parameter
NameDescription
destinationSinkInfo.Destination
Returns
TypeDescription
Sink.Builder
Overrides

setFilter(String filter)

public Sink.Builder setFilter(String filter)

Sets an advanced logs filter. Only log entries matching that filter are exported. The filter must be consistent with the log entry format specified with #setVersionFormat(VersionFormat), regardless of the format of the log entry that was originally written to Cloud Logging. Example (V2 format): logName=projects/my-projectid/logs/syslog AND severity>=ERROR.

Parameter
NameDescription
filterString
Returns
TypeDescription
Sink.Builder
Overrides

setName(String name)

public Sink.Builder setName(String name)

Sets the name of the sink. Example: my-severe-errors-to-pubsub. Sink identifiers are limited to 1000 characters and can include only the following characters: A-Z, a-z, 0-9, and the special characters _-..

Parameter
NameDescription
nameString
Returns
TypeDescription
Sink.Builder
Overrides

setVersionFormat(SinkInfo.VersionFormat versionFormat)

public Sink.Builder setVersionFormat(SinkInfo.VersionFormat versionFormat)

Sets the log entry version to use for this sink's exported log entries. This version does not have to correspond to the version of the log entry when it was written to Google Cloud Logging.

Parameter
NameDescription
versionFormatSinkInfo.VersionFormat
Returns
TypeDescription
Sink.Builder
Overrides