Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Cloud Functions
  • Comparison with other Yandex Cloud services
    • Overview
    • Function
    • Invoking a function
    • Asynchronous function invocation
    • Long-lived functions
    • Function termination notifications
    • Networking
    • Mounting external resources to a function file system
    • Builder
      • Overview
      • Timer
      • Trigger for Message Queue
      • Trigger for Object Storage
      • Trigger for Container Registry
      • Trigger for Cloud Logging
      • Trigger for Yandex IoT Core
      • Trigger for budgets
      • Trigger for Data Streams
      • Email trigger
    • Dead Letter Queue
    • Function logs
    • Backups
    • Quotas and limits
  • Tools
  • Pricing policy
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ

In this article:

  • Batching
  • Roles required for the proper operation of a trigger for Cloud Logging
  • Format of the message from the trigger for Cloud Logging
  • Use cases
  • See also
  1. Concepts
  2. Trigger
  3. Trigger for Cloud Logging

Trigger for Cloud Logging that invokes a Cloud Functions function

Written by
Yandex Cloud
Updated at April 18, 2025
  • Batching
  • Roles required for the proper operation of a trigger for Cloud Logging
  • Format of the message from the trigger for Cloud Logging
  • Use cases
  • See also

A trigger for Cloud Logging runs a Cloud Functions function when messages are received in a log group.

A trigger for Cloud Logging needs a service account to read messages from the log group and invoke a function.

For more information about creating a trigger for Cloud Logging, see Creating a trigger for Cloud Logging that invokes a Cloud Functions function.

BatchingBatching

Batching settings allow you to send multiple messages to a function at the same time. They set a top limit on the size of a message group and its accumulation time. For example, if the size of a message group is 3, the function can receive groups that contain from 1 to 3 messages.

Roles required for the proper operation of a trigger for Cloud LoggingRoles required for the proper operation of a trigger for Cloud Logging

  • To create a trigger, you need a permission for the service account under which the trigger runs the operation. This permission comes with the iam.serviceAccounts.user and editor roles or higher.
  • For the trigger to fire, the service account needs the following roles:
    • functions.functionInvoker for the function that the trigger invokes.
    • logging.reader for the log group that will fire the trigger when entries are added to it.

Format of the message from the trigger for Cloud LoggingFormat of the message from the trigger for Cloud Logging

After the trigger is activated, it sends the following message to the function:

{
   "messages":[
      {
         "event_metadata":{
            "event_id":"2c59a567-6666-4b65-a0b0-cc12********",
            "event_type":"yandex.cloud.events.serverless.triggers.LoggingMessageBatch",
            "created_at":{
               "seconds":1630607359,
               "nanos":6794776
            }
         },
         "details":{
            "messages":[
               {
                  "resource":{
                     "type":"serverless.function",
                     "id":"b09tm9raoev5********"
                  },
                  "timestamp":"2021-09-02 18:29:17.118082213 +0000 UTC",
                  "level":"INFO",
                  "message":"START RequestID: 085035c7-2319-40dd-bb03-fd8t******** Version: b09s5cq4b935********",
                  "json_payload":{
                     "request_id":"085035c7-2319-40dd-bb03-fdb2********",
                     "version_id":"b09s5cq4b935********"
                  }
               }
            ]
         }
      }
   ]
}

Use casesUse cases

  • Configuring responses in Yandex Cloud Logging and Cloud Functions
  • Writing load balancer logs to PostgreSQL

See alsoSee also

  • Trigger for Cloud Logging that invokes a Serverless Containers container
  • Trigger for Cloud Logging that sends messages to WebSocket connections

Was the article helpful?

Previous
Trigger for Container Registry
Next
Trigger for Yandex IoT Core
© 2025 Direct Cursus Technology L.L.C.