Fluent Bit with a Cloud Logging plugin
Fluent Bit is an open-source multi-platform tool for collecting and processing logs. Fluent Bit collects, parses, and filters messages from a variety of inputs and saves them to storage. Once a message is saved, it is forwarded from storage to a router that determines which destination to route it to. Plugins are used to work with various inputs and outputs.
A plugin for Cloud Logging is used to export logs generated in Kubernetes clusters, including at the pod level, to Yandex Cloud Logging.
Create a service account to run Fluent Bit.
Create an authorized key for the service account and save it to a file named
yc iam key create \ --service-account-name <service account name> \ --output sa-key.json
Create a log group.
If you want to save logs to Yandex Object Storage:
Set the Fluent Bit settings:
- Namespace: Select a namespace or create a new one.
- Application name: Enter an application name.
- Target log group ID: Specify an ID of the log group to which logs will be transmitted.
- Service account key for Cloud Logging: Paste the contents of the
- Save logs to Object Storage: Select this option if you want to save logs to Object Storage.
- Object Storage bucket name: Specify the name of the bucket where logs will be stored. Leave the field blank if you do not want to save logs.
- Static access key for Object Storage: Paste the static access key in JSON format. Leave the field blank if you do not want to save logs.