-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set up template output plugin that writes to a file. #2
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to do a pass on the doc strings + comments. Many are not formatted correctly.
Made updates to comments and doc strings for line wrapping, capitalization and periods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets tweak the title + commit message to:
Set up template output plugin that writes to a file. (#2)
Description
Added basic file output plugin. Plugin will serve as a template onto which IR and S3 output functionality will be added.
Plugin
File plugin is based on example stdout plugin provided by fluent-bit. The main file which implements required callbacks is
plugins/out_clp_s3/out_clp_s3.go
. I made the following changes to enhance functionalityconfig/config.go
plugins/out_clp_s3/flush/flush.go
(code will be deleted on next PR)internal/utils/error.go
Development aids
In addition to plugin, I added
plugins/out_clp_s3/Dockerfile
plugins/out_clp_s3/Makefile
Docker
In addition to plugin, I added a dockerfile so new users/developers can test quickly. The dockerfile first builds the plugin in a go container and then copies the binary to a fluentbit container. The fluentbit container starts fluentbit with the output plugin and writes logs to the current directory using a docker volume.
The repo also contains two example fluent-bit configuration files.
plugins/out_clp_s3/fluent-bit.conf
is the main configuration file.plugins/out_clp_s3/plugin-config.conf
provides the path to plugin binary. Both of these configuration are setup with paths that exists on the docker container, but can be modified for local use (however, modification may break docker setup)Make
basic makefile to build plugin
Validation performed
I built plugin and tested can write to file locally, and with docker.