Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/relex/fluentlib
A Go library for Fluentd's forward protocol and tools for Fluentd / Fluent Bit
https://github.com/relex/fluentlib
fluent-bit fluentd golang
Last synced: about 2 months ago
JSON representation
A Go library for Fluentd's forward protocol and tools for Fluentd / Fluent Bit
- Host: GitHub
- URL: https://github.com/relex/fluentlib
- Owner: relex
- License: mit
- Created: 2021-04-15T06:51:38.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-16T10:54:14.000Z (8 months ago)
- Last Synced: 2024-05-16T11:53:17.178Z (8 months ago)
- Topics: fluent-bit, fluentd, golang
- Language: Go
- Homepage:
- Size: 80.1 KB
- Stars: 4
- Watchers: 7
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fluentdlib
A library for Fluentd's [forward](https://github.com/fluent/fluentd/wiki/Forward-Protocol-Specification-v1) protocol and tools for Fluentd / Fluent Bit
## Tools
Dump contents of Fluentd Forward messages (Forward, PackedForward, CompressedPackedForward) and Fluent Bit chunk files:
```bash
fluentlibtool dump [filepath]...
```Run a fake Fluentd server to print logs in JSON to stdout or one file per each tag + key fields
```bash
fluentlibtool server -f 0 -x 0 -n 0.5
``````bash
fluentlibtool server --split_output_keys=environment/class,level --split_output_path=/tmp/%s.json --split_strict_mode=true
```(`-f`, `-x`, and `-n` are to simulate network errors etc, use `fluentlibtool help server` to get help)
## Library
- `protocol/fluentbitchunk` can decode Fluent Bit's [internal chunk (buffer) files](https://docs.fluentbit.io/manual/administration/buffering-and-storage).
- `protocol/forwardprotocol` provides definitions of [Fluentd Forward Protocol v1](https://github.com/fluent/fluentd/wiki/Forward-Protocol-Specification-v1) in Go, as well as utility functions for handshaking and decoding.
- `server` provides a fake Fluentd server that can be used for testingThe library part is intended for verification and functions here are NOT optimized for performance.
See `server/server_test.go:TestServerBasic` for basic examples of a client
## Build
1. Install go
2. Install https://github.com/relex/gotils```bash
make
make test
```