Class: Google::Logging::V2::LogSink
- Inherits:
-
Object
- Object
- Google::Logging::V2::LogSink
- Defined in:
- lib/google/cloud/logging/v2/doc/google/logging/v2/logging_config.rb
Overview
Describes a sink used to export log entries outside of Stackdriver Logging. A logs filter controls which log entries are exported. Sinks can have a start time and an end time; these can be used to place log entries from an exact time range into a particular destination. If both +start_time+ and +end_time+ are present, then +start_time+ must be less than +end_time+.
Defined Under Namespace
Modules: VersionFormat
Instance Attribute Summary collapse
-
#destination ⇒ String
Required.
-
#end_time ⇒ Google::Protobuf::Timestamp
Optional.
-
#filter ⇒ String
Optional.
-
#name ⇒ String
Required.
-
#output_version_format ⇒ Google::Logging::V2::LogSink::VersionFormat
Optional.
-
#start_time ⇒ Google::Protobuf::Timestamp
Optional.
-
#writer_identity ⇒ String
Output only.
Instance Attribute Details
#destination ⇒ String
Returns 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]"
For more information, see Logs With Sinks[https://cloud.google.com/logging/docs/api/tasks/exporting-logs].
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/google/cloud/logging/v2/doc/google/logging/v2/logging_config.rb', line 73 class LogSink # Available log entry formats. Log entries can be written to Stackdriver # Logging in either format and can be exported in either format. # Version 2 is the preferred format. module VersionFormat # An unspecified version format will default to V2. VERSION_FORMAT_UNSPECIFIED = 0 # +LogEntry+ version 2 format. V2 = 1 # +LogEntry+ version 1 format. V1 = 2 end end |
#end_time ⇒ Google::Protobuf::Timestamp
Returns Optional. Time at which this sink will stop exporting log entries. If this value is present, then log entries are exported only if +entry.timestamp+ < +end_time+.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/google/cloud/logging/v2/doc/google/logging/v2/logging_config.rb', line 73 class LogSink # Available log entry formats. Log entries can be written to Stackdriver # Logging in either format and can be exported in either format. # Version 2 is the preferred format. module VersionFormat # An unspecified version format will default to V2. VERSION_FORMAT_UNSPECIFIED = 0 # +LogEntry+ version 2 format. V2 = 1 # +LogEntry+ version 1 format. V1 = 2 end end |
#filter ⇒ String
Returns Optional. An logs filter[https://cloud.google.com/logging/docs/view/advanced_filters]. Only log entries matching the filter are exported. The filter must be consistent with the log entry format specified by the +outputVersionFormat+ parameter, regardless of the format of the log entry that was originally ingested by Stackdriver Logging. The following example uses field names in the v2 log entry format:
logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/google/cloud/logging/v2/doc/google/logging/v2/logging_config.rb', line 73 class LogSink # Available log entry formats. Log entries can be written to Stackdriver # Logging in either format and can be exported in either format. # Version 2 is the preferred format. module VersionFormat # An unspecified version format will default to V2. VERSION_FORMAT_UNSPECIFIED = 0 # +LogEntry+ version 2 format. V2 = 1 # +LogEntry+ version 1 format. V1 = 2 end end |
#name ⇒ String
Returns 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.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/google/cloud/logging/v2/doc/google/logging/v2/logging_config.rb', line 73 class LogSink # Available log entry formats. Log entries can be written to Stackdriver # Logging in either format and can be exported in either format. # Version 2 is the preferred format. module VersionFormat # An unspecified version format will default to V2. VERSION_FORMAT_UNSPECIFIED = 0 # +LogEntry+ version 2 format. V2 = 1 # +LogEntry+ version 1 format. V1 = 2 end end |
#output_version_format ⇒ Google::Logging::V2::LogSink::VersionFormat
Returns Optional. 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 that was written to Stackdriver Logging. If omitted, the v2 format is used.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/google/cloud/logging/v2/doc/google/logging/v2/logging_config.rb', line 73 class LogSink # Available log entry formats. Log entries can be written to Stackdriver # Logging in either format and can be exported in either format. # Version 2 is the preferred format. module VersionFormat # An unspecified version format will default to V2. VERSION_FORMAT_UNSPECIFIED = 0 # +LogEntry+ version 2 format. V2 = 1 # +LogEntry+ version 1 format. V1 = 2 end end |
#start_time ⇒ Google::Protobuf::Timestamp
Returns Optional. The time at which this sink will begin exporting log entries. If this value is present, then log entries are exported only if +start_time+ <=+entry.timestamp+.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/google/cloud/logging/v2/doc/google/logging/v2/logging_config.rb', line 73 class LogSink # Available log entry formats. Log entries can be written to Stackdriver # Logging in either format and can be exported in either format. # Version 2 is the preferred format. module VersionFormat # An unspecified version format will default to V2. VERSION_FORMAT_UNSPECIFIED = 0 # +LogEntry+ version 2 format. V2 = 1 # +LogEntry+ version 1 format. V1 = 2 end end |
#writer_identity ⇒ String
Returns Output only. An IAM identity—a service account or group—that will write exported log entries to the destination on behalf of Stackdriver Logging. You must grant this identity write-access to the destination. Consult the destination service's documentation to determine the exact role that must be granted.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/google/cloud/logging/v2/doc/google/logging/v2/logging_config.rb', line 73 class LogSink # Available log entry formats. Log entries can be written to Stackdriver # Logging in either format and can be exported in either format. # Version 2 is the preferred format. module VersionFormat # An unspecified version format will default to V2. VERSION_FORMAT_UNSPECIFIED = 0 # +LogEntry+ version 2 format. V2 = 1 # +LogEntry+ version 1 format. V1 = 2 end end |