11# Fluent Bit CLP Plugins
22
33[ Fluent Bit] [ fluent-bit ] output plugins that compress logs using [ CLP] [ clp-blog ] for efficient
4- storage and search on AWS S3.
5-
6- ## Table of Contents
7-
8- - [ Overview] ( #overview )
9- - [ Which Plugin Should I Use?] ( #which-plugin-should-i-use )
10- - [ Quick Start] ( #quick-start )
11- - [ Docker Images] ( #docker-images )
12- - [ Pre-built Binaries] ( #pre-built-binaries )
13- - [ Documentation] ( #documentation )
14- - [ Development] ( #development )
4+ storage and search on S3.
155
166## Overview
177
@@ -23,126 +13,96 @@ flowchart LR
2313 D --> E[YScope Log Viewer]
2414```
2515
26- ** [ CLP] [ clp-blog ] ** (Compressed Log Processor) is a log compression tool that achieves 10-100x
27- better compression than gzip while enabling fast search. These plugins compress logs into CLP's
28- Intermediate Representation (IR) format with [ Zstd] [ zstd ] compression, then upload to S3.
16+ ** [ CLP] [ clp-blog ] ** (Compressed Log Processor) achieves 10-100x better compression than gzip while
17+ enabling fast search. These plugins compress logs into CLP's Intermediate Representation (IR)
18+ format with [ Zstd] [ zstd ] compression, then upload to S3.
2919
30- Use [ YScope Log Viewer] [ log-viewer ] to view compressed logs directly in the browser , or ingest
31- into CLP for search at scale.
20+ View compressed logs directly in the browser with [ YScope Log Viewer] [ log-viewer ] , or ingest into
21+ CLP for search at scale.
3222
33- ## Which Plugin Should I Use?
23+ ## Plugins
3424
35- | Plugin | Upload Trigger | Best For |
36- | --------| ---------------| ----------|
37- | ** [ out_clp_s3_v2] ( plugins/out_clp_s3_v2/README.md ) ** | Time-based (per log level) | Kubernetes, latency-sensitive workloads |
38- | ** [ out_clp_s3] ( plugins/out_clp_s3/README.md ) ** | Size-based (MB threshold) | Batch processing, size optimization |
25+ Two plugins with different log delivery strategies:
3926
40- ** Recommended: Start with ` out_clp_s3_v2 ` ** - it offers more control over upload latency and
41- works well with Kubernetes deployments.
27+ | Plugin | Strategy | Description |
28+ | --------| ----------| -------------|
29+ | ** [ out_clp_s3_v2] ( plugins/out_clp_s3_v2/README.md ) ** | Continuous sync | Compressed logs continuously synced to S3; sync frequency tunable to balance freshness vs cost |
30+ | ** [ out_clp_s3] ( plugins/out_clp_s3/README.md ) ** | Batch upload | Logs buffered locally until size threshold reached, then uploaded as batch |
4231
43- ### out_clp_s3_v2 (Recommended)
32+ ### out_clp_s3_v2 — Continuous Sync
4433
45- Time-based flushing with per-log-level control:
46- - ERROR logs uploaded in seconds, DEBUG logs batched for minutes
47- - Dual-timer strategy (hard + soft) prevents upload storms
34+ Log rotation is delegated to the log appender. The plugin continuously syncs compressed log files
35+ to S3.
36+
37+ - Higher severity logs (e.g., ERROR) trigger faster sync of the entire log file
38+ - Dual-timer strategy (hard + soft deadlines) prevents upload storms
4839- Designed for Kubernetes (sidecar and DaemonSet patterns)
49- - MinIO compatible for local development
5040
51- ### out_clp_s3
41+ ### out_clp_s3 — Batch Upload
42+
43+ Logs are buffered locally and uploaded when a size threshold is reached.
5244
53- Size-based uploads with crash recovery:
5445- Upload when buffer reaches size threshold (default 16 MB)
5546- Disk buffering with crash recovery
5647- IAM role assumption for cross-account access
57- - Single key extraction from log records
5848
5949## Quick Start
6050
61- ### Docker Compose (Easiest)
62-
63- The fastest way to try the plugins locally:
51+ The fastest way to try locally with Docker Compose:
6452
6553``` shell
66- # out_clp_s3_v2 (recommended)
67- cd plugins/out_clp_s3_v2/examples/docker-compose
68- docker compose up
54+ git clone --recursive https://github.com/y-scope/fluent-bit-clp.git
55+ cd fluent-bit-clp
56+
57+ # Choose one:
58+ cd plugins/out_clp_s3_v2/examples/docker-compose # Continuous sync
59+ cd plugins/out_clp_s3/examples/docker-compose # Batch upload
6960
70- # out_clp_s3
71- cd plugins/out_clp_s3/examples/docker-compose
7261docker compose up
7362```
7463
75- This starts MinIO, Fluent Bit with the plugin, and a log generator. View logs at
76- http://localhost:9001 (minioadmin/minioadmin).
77-
78- ### Kubernetes (k3d)
64+ This starts MinIO (S3-compatible storage), Fluent Bit with the plugin, and a log generator.
65+ View logs at http://localhost:9001 (minioadmin/minioadmin).
7966
80- ``` shell
81- # Download plugins from GitHub Actions (see Pre-built Binaries section)
82- # Extract to a local directory, e.g., ./plugins/
83-
84- # Create k3d cluster with plugin mounted
85- k3d cluster create yscope --servers 1 --agents 1 \
86- -v $( pwd) /plugins:/fluent-bit/plugins \
87- -p 9000:30000@agent:0 -p 9001:30001@agent:0
88-
89- # Deploy MinIO and Fluent Bit
90- cd plugins/out_clp_s3_v2/examples/kubernetes
91- kubectl apply -f minio.yaml -f aws-credentials.yaml
92- kubectl apply -f logs-bucket-creation.yaml
93- kubectl apply -f sidecar/fluent-bit-sidecar.yaml -f sidecar/fluent-bit-sidecar-config.yaml
94- ```
67+ ## Installation
9568
96- See [ Kubernetes Examples] ( plugins/out_clp_s3_v2/examples/kubernetes/README.md ) for sidecar and
97- DaemonSet deployment patterns.
69+ ### Docker Images
9870
99- ### Docker (Build from Source)
71+ Pre-built Fluent Bit images with CLP plugins:
10072
10173``` shell
102- # out_clp_s3_v2
103- cd plugins/out_clp_s3_v2
104- docker build -t fluent-bit-clp-v2 -f Dockerfile ../../
105- docker run -v ~ /.aws/credentials:/root/.aws/credentials fluent-bit-clp-v2
106-
107- # out_clp_s3
108- cd plugins/out_clp_s3
109- docker build -t fluent-bit-clp -f Dockerfile ../../
110- docker run -v ~ /.aws/credentials:/root/.aws/credentials fluent-bit-clp
74+ docker pull ghcr.io/y-scope/fluent-bit-clp-s3-v2:latest # Continuous sync
75+ docker pull ghcr.io/y-scope/fluent-bit-clp-s3:latest # Batch upload
11176```
11277
113- ## Docker Images
114-
115- Pre-built Fluent Bit images with CLP plugins are published to GitHub Container Registry:
116-
117- ``` shell
118- # Time-based plugin (recommended)
119- docker pull ghcr.io/y-scope/fluent-bit-clp-s3-v2:latest
78+ Images are tagged with ` latest ` (main branch), branch names, and commit SHAs.
12079
121- # Size-based plugin
122- docker pull ghcr.io/y-scope/fluent-bit-clp-s3:latest
123- ```
80+ ### Pre-built Binaries
12481
125- Images are tagged with ` latest ` (main branch), branch names, and commit SHAs.
82+ Standalone ` .so ` plugin files available from [ GitHub Releases ] ( ../../releases ) :
12683
127- ## Pre-built Binaries
84+ | File | Architecture |
85+ | ------| --------------|
86+ | ` out_clp_s3_v2_linux_amd64.so ` | x86_64 |
87+ | ` out_clp_s3_v2_linux_arm64.so ` | ARM64 |
88+ | ` out_clp_s3_linux_amd64.so ` | x86_64 |
89+ | ` out_clp_s3_linux_arm64.so ` | ARM64 |
12890
129- Standalone plugin binaries ( ` .so ` files) are also available as GitHub Actions artifacts .
91+ Also available as zip from [ Actions → build ] ( ../../actions/workflows/build.yaml ) .
13092
131- ** Download:** Go to [ Actions → build] ( ../../actions/workflows/build.yaml ) , select a workflow run,
132- and download the ` fluent-bit-clp-plugins-linux-amd64 ` artifact.
93+ ## Kubernetes
13394
134- | File | Plugin |
135- | ------ | -------- |
136- | ` out_clp_s3_v2_linux_amd64.so ` | Time-based plugin (recommended) |
137- | ` out_clp_s3_linux_amd64.so ` | Size-based plugin |
95+ See [ Kubernetes Examples ] ( plugins/out_clp_s3_v2/examples/kubernetes/README.md ) for:
96+ - Local development with k3d
97+ - Production deployment with init containers
98+ - Sidecar and DaemonSet patterns
13899
139100## Documentation
140101
141102| Document | Description |
142103| ----------| -------------|
143- | [ out_clp_s3_v2 README] ( plugins/out_clp_s3_v2/README.md ) | Configuration, flush strategy, Kubernetes deployment |
144- | [ out_clp_s3 README] ( plugins/out_clp_s3/README.md ) | Configuration, disk buffering, crash recovery |
145- | [ Kubernetes Examples] ( plugins/out_clp_s3_v2/examples/kubernetes/README.md ) | Sidecar and DaemonSet deployments |
104+ | [ out_clp_s3_v2 README] ( plugins/out_clp_s3_v2/README.md ) | Configuration and flush strategy |
105+ | [ out_clp_s3 README] ( plugins/out_clp_s3/README.md ) | Configuration and disk buffering |
146106
147107## Development
148108
@@ -151,22 +111,13 @@ and download the `fluent-bit-clp-plugins-linux-amd64` artifact.
151111- Go 1.24+
152112- [ Task] ( https://taskfile.dev/installation/ )
153113
154- ### Cloning
155-
156- This project uses git submodules for the [ clp-ffi-go] ( https://github.com/y-scope/clp-ffi-go )
157- dependency:
114+ ### Building
158115
159116``` shell
160- # New clone (recommended)
117+ # Clone with submodules
161118git clone --recursive https://github.com/y-scope/fluent-bit-clp.git
119+ cd fluent-bit-clp
162120
163- # Existing clone
164- git submodule update --init --recursive
165- ```
166-
167- ### Building
168-
169- ``` shell
170121# Download clp-ffi-go native libraries
171122bash third-party/clp-ffi-go/scripts/download-libs.sh
172123
@@ -177,19 +128,11 @@ task build
177128### Linting
178129
179130``` shell
180- # Install prerequisites
181- # - Task: https://taskfile.dev/installation/
182- # - uv: https://docs.astral.sh/uv/getting-started/installation/
183-
184- # Run checks
185- task lint:check
186-
187- # Auto-fix
188- task lint:fix
131+ task lint:check # Run checks
132+ task lint:fix # Auto-fix
189133```
190134
191- > ** Note:** Linting for the v1 plugin (` out_clp_s3 ` ) is currently disabled and will be addressed in
192- > a future update.
135+ > ** Note:** Linting for ` out_clp_s3 ` is temporarily disabled.
193136
194137[ clp-blog ] : https://www.uber.com/blog/reducing-logging-cost-by-two-orders-of-magnitude-using-clp
195138[ fluent-bit ] : https://fluentbit.io/
0 commit comments