You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: development/golang-output-plugins.md
+60-30Lines changed: 60 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,18 @@
1
-
# Golang Output Plugins
1
+
# Golang output plugins
2
2
3
-
Fluent Bit 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.
3
+
Fluent Bit 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.
4
4
5
-
## Getting Started
5
+
## Get started
6
6
7
-
Compile Fluent Bit with Golang support, e.g:
7
+
Compile Fluent Bit with Golang support:
8
8
9
-
```text
10
-
$ cd build/
11
-
$ cmake -DFLB_DEBUG=On -DFLB_PROXY_GO=On ../
12
-
$ make
9
+
```shell
10
+
cd build/
11
+
cmake -DFLB_DEBUG=On -DFLB_PROXY_GO=On ../
12
+
make
13
13
```
14
14
15
-
Once compiled, we can see a new option in the binary `-e`which stands for _external plugin_, e.g:
15
+
Once compiled, you can see the new `-e`option in the binary which stands for _external plugin_.
16
16
17
17
```text
18
18
$ bin/fluent-bit -h
@@ -30,13 +30,13 @@ Available Options
30
30
...
31
31
```
32
32
33
-
## Build a Go Plugin
33
+
## Build a Go plugin
34
34
35
-
The _fluent-bit-go_ package is available to assist developers in creating Go plugins.
35
+
The `fluent-bit-go` package is available to assist developers in creating Go plugins.
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.
73
+
The previous code is a template to write an output plugin. It's 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.
74
74
75
-
To build the code above, use the following line:
75
+
To build the code, use the following line:
76
76
77
77
```bash
78
-
$ go build -buildmode=c-shared -o out_gstdout.so out_gstdout.go
78
+
go build -buildmode=c-shared -o out_gstdout.so out_gstdout.go
79
79
```
80
80
81
-
Once built, a shared library called `out\_gstdout.so` 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:
81
+
Once built, a shared library called `out_gstdout.so` will be available. Confirm the
82
+
final `.so` file is as expected. When you use the `ldd` over the library should see
@@ -118,11 +120,11 @@ Fluent Bit can load / run Golang plugin using two configuration file.
118
120
119
121
The keys for Golang plugin available as of this version are described in the following table:
120
122
121
-
| Key | Description | Default Value|
122
-
| ---- | ----------- | ------------ |
123
-
| Plugins_file | Path for a plugins configuration file. A _plugins_ configuration file allows to define paths for external plugins, for an example [see here](https://github.com/fluent/fluent-bit/blob/master/conf/plugins.conf).||
123
+
| Key | Description |
124
+
| ---- | ----------- |
125
+
|`Plugins_file`| Path for a plugins configuration file. A plugins configuration file let you define paths for external plugins. For example,[see here](https://github.com/fluent/fluent-bit/blob/master/conf/plugins.conf). |
124
126
125
-
#### Example
127
+
#### Main configuration file example
126
128
127
129
The following is an example of a main configuration file.
128
130
@@ -139,13 +141,41 @@ The following is an example of a main configuration file.
139
141
140
142
#### Config key constraint
141
143
142
-
Some config keys are reserved by Fluent Bit 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`
144
+
The following configuration keys are reserved by Fluent Bit and must not be used by a custom plugin:
145
+
146
+
-`alias`
147
+
-`host`
148
+
-`ipv6`
149
+
-`listen`
150
+
-`log_level`
151
+
-`log_suppress_interval`
152
+
-`match`
153
+
-`match_regex`
154
+
-`mem_buf_limit`
155
+
-`port`
156
+
-`retry_limit`
157
+
-`routable`
158
+
-`storage.pause_on_chunks_overlimit`
159
+
-`storage.total_limit_size`
160
+
-`storage.type`
161
+
-`tag`
162
+
-`threaded`
163
+
-`tls`
164
+
-`tls.ca_file`
165
+
-`tls.ca_path`
166
+
-`tls.crt_file`
167
+
-`tls.debug`
168
+
-`tls.key_file`
169
+
-`tls.key_passwd`
170
+
-`tls.verify`
171
+
-`tls.vhost`
172
+
-`workers`
143
173
144
174
### Run using a configuration file
145
175
146
-
We can load a main configuration file using `-c` option.
176
+
You can load a main configuration file using `-c` option.
147
177
Note: No need to specify a plugins configuration file from command line.
0 commit comments