Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Solutions
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Managed Service for PostgreSQL
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Information about existing clusters
    • Creating clusters
    • Connecting to databases
    • Stop and start the cluster
    • SQL queries in the management console
    • Changing cluster and database settings
    • Connecting to DataLens
    • Managing PostgreSQL hosts
    • Database management
    • How to manage PostgreSQL extensions
    • Managing database users
    • Granting permissions and roles
    • Managing backups
    • Deleting clusters
    • Database migration to the Cloud
    • Creating a logical replica of Amazon RDS for PostgreSQL in Managed Service for PostgreSQL
  • Solutions
    • Creating a PostgreSQL cluster for 1C
  • Concepts
    • Relationship between service resources
    • Host classes
    • Network in Yandex Managed Service for PostgreSQL
    • Quotas and limits
    • Storage types
    • Backups
    • Assigning roles
    • Replication
    • Supported clients
  • Access management
  • Pricing policy
    • Current pricing policy
    • Archive
      • Before January 1, 2019
      • From January 1 to March 1, 2019
      • From March 1, 2019 to February 1, 2020
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • BackupService
      • ClusterService
      • DatabaseService
      • ResourcePresetService
      • UserService
      • OperationService
    • REST
      • Overview
      • Backup
        • Overview
        • get
        • list
      • Cluster
        • Overview
        • addHosts
        • backup
        • create
        • delete
        • deleteHosts
        • get
        • list
        • listBackups
        • listHosts
        • listLogs
        • listOperations
        • move
        • rescheduleMaintenance
        • restore
        • start
        • startFailover
        • stop
        • streamLogs
        • update
        • updateHosts
      • Database
        • Overview
        • create
        • delete
        • get
        • list
        • update
      • ResourcePreset
        • Overview
        • get
        • list
      • User
        • Overview
        • create
        • delete
        • get
        • grantPermission
        • list
        • revokePermission
        • update
      • Operation
        • Overview
        • get
  • Questions and answers
    • General questions
    • Questions about PostgreSQL
    • All questions on the same page
  1. API reference
  2. REST
  3. Cluster
  4. streamLogs

Method streamLogs

  • HTTP request
  • Path parameters
  • Query parameters
  • Response

Same as ListLogs but using server-side streaming. Also allows for 'tail -f' semantics.

HTTP request

GET https://mdb.api.cloud.yandex.net/managed-postgresql/v1/clusters/{clusterId}:stream_logs

Path parameters

Parameter Description
clusterId Required. Required. ID of the PostgreSQL cluster. The maximum string length in characters is 50.

Query parameters

Parameter Description
columnFilter Columns from logs table to get in the response.
serviceType
  • POSTGRESQL: Logs of PostgreSQL activity.
  • POOLER: Logs of connection pooler activity.
fromTime Start timestamp for the logs request. String in RFC3339 text format.
toTime End timestamp for the logs request. If this field is not set, all existing logs will be sent and then the new ones as they appear. In essence it has 'tail -f' semantics. String in RFC3339 text format.
recordToken Record token. Set record_token to the next_record_token returned by a previous StreamLogs request to start streaming from next log record. The maximum string length in characters is 100.
filter A filter expression that filters resources listed in the response. The expression must specify: 1. The field name. Currently filtering can be applied to the [LogRecord.logs.message.hostname], [LogRecord.logs.message.error_severity] (for POSTGRESQL service), [LogRecord.logs.message.level] (for POOLER service) fields. 2. A conditional operator. Can be either = or != for single values, IN or NOT IN for lists of values. 3. The value. Must be 1-63 characters long and match the regular expression ^[a-z0-9.-]{1,61}$. Examples of a filter: message.hostname='node1.db.cloud.yandex.net' message.error_severity IN ("ERROR", "FATAL", "PANIC") AND message.hostname = "node1.db.cloud.yandex.net" The maximum string length in characters is 1000.

Response

HTTP Code: 200 - OK

{
  "record": {
    "timestamp": "string",
    "message": "object"
  },
  "nextRecordToken": "string"
}
Field Description
record object

One of the requested log records.

record.
timestamp
string (date-time)

Log record timestamp in RFC3339 text format.

String in RFC3339 text format.

record.
message
object

Contents of the log record.

nextRecordToken string

This token allows you to continue streaming logs starting from the exact same record. To continue streaming, specify value of next_record_token as value for record_token parameter in the next StreamLogs request. This value is interchangeable with next_page_token from ListLogs method.

In this article:
  • HTTP request
  • Path parameters
  • Query parameters
  • Response
Language / Region
Careers
Privacy policy
Terms of use
Brandbook
© 2021 Yandex.Cloud LLC