Calyptia Core Agent

Golang Output Plugins

Calyptia Core Agent currently supports integration of Golang plugins built as shared objects for output plugins only. The interface for the Golang plugins is currently under development but is functional.

Build a Go Plugin

The fluent-bit-go package is available to assist developers in creating Go plugins.
At a minimum, a Go plugin looks like this:
package main
import ""
//export FLBPluginRegister
func FLBPluginRegister(def unsafe.Pointer) int {
// Gets called only once when the is loaded
return output.FLBPluginRegister(ctx, "gstdout", "Stdout GO!")
//export FLBPluginInit
func FLBPluginInit(plugin unsafe.Pointer) int {
// Gets called only once for each instance you have configured.
return output.FLB_OK
//export FLBPluginFlushCtx
func FLBPluginFlushCtx(ctx, data unsafe.Pointer, length, tag *C.char) int {
// Gets called with a batch of records to be written to an instance.
return output.FLB_OK
//export FLBPluginExit
func FLBPluginExit() int {
return output.FLB_OK
func main() {
the code above is a template to write an output plugin, it's really important to keep the package name as main and add an explicit main() function. This is a requirement as the code will be build as a shared library.
To build the code above, use the following line:
$ go build -buildmode=c-shared -o out_gstdout.go
Once built, a shared library called out\ will be available. It's really important to double check the final .so file is what we expect. Doing a ldd over the library we should see something similar to this:
$ ldd => (0x00007fff561dd000) => /lib/x86_64-linux-gnu/ (0x00007fc4aeef0000) => /lib/x86_64-linux-gnu/ (0x00007fc4aeb27000)
/lib64/ (0x000055751a4fd000)

Run Calyptia Core Agent with the new plugin

$ bin/calyptia-fluent-bit -e /path/to/ -i cpu -o gstdout

Configuration file

Calyptia Core Agent can load / run Golang plugin using two configuration file.

Plugins configuration file

Default Value
A path for a Golang plugin.


Path /path/to/

Main configuration file

The keys for Golang plugin available as of this version are described in the following table:
Default Value
Path for a plugins configuration file. A plugins configuration file allows to define paths for external plugins, for an example see here.


The following is an example of a main configuration file.
plugins_file /path/to/plugins.conf
Name dummy
Name gstdout

Config key constraint

Some config keys are reserved by Calyptia Core Agent and must not be used by a custom plugin, they are: alias,host,ipv6,listen,log_level,log_suppress_interval,match,match_regex,mem_buf_limit,port,retry_limit,routable,storage.pause_on_chunks_overlimit, storage.total_limit_size, storage.type, tag,threaded,tls,tls.ca_file, tls.ca_path, tls.crt_file, tls.debug, tls.key_file, tls.key_passwd, tls.verify, tls.vhost, workers

Run using a configuration file

We can load a main configuration file using -c option. Note: No need to specify a plugins configuration file from command line.
calyptia-fluent-bit -c calyptia-fluent-bit.conf