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
+58-31Lines changed: 58 additions & 31 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 final `.so` file is as expected. When you use the `ldd` over the library should see something similar to this:
@@ -118,11 +118,11 @@ Fluent Bit can load / run Golang plugin using two configuration file.
118
118
119
119
The keys for Golang plugin available as of this version are described in the following table:
120
120
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).||
121
+
| Key | Description |
122
+
| ---- | ----------- |
123
+
|`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
124
125
-
#### Example
125
+
#### Main configuration file example
126
126
127
127
The following is an example of a main configuration file.
128
128
@@ -139,13 +139,40 @@ The following is an example of a main configuration file.
139
139
140
140
#### Config key constraint
141
141
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`
142
+
The following configuration keys are reserved by Fluent Bit and must not be used by a custom plugin:
143
+
144
+
-`alias`
145
+
-`host`
146
+
-`ipv6`
147
+
-`listen`
148
+
-`log_level`
149
+
-`log_suppress_interval`
150
+
-`match`
151
+
-`match_regex`
152
+
-`mem_buf_limit`
153
+
-`port`
154
+
-`retry_limit`
155
+
-`routable`
156
+
-`storage.pause_on_chunks_overlimit`
157
+
-`storage.total_limit_size`
158
+
-`storage.type`
159
+
-`tag`
160
+
-`threaded`
161
+
-`tls`
162
+
-`tls.ca_file`
163
+
-`tls.ca_path`
164
+
-`tls.crt_file`
165
+
-`tls.debug`
166
+
-`tls.key_file`
167
+
-`tls.key_passwd`
168
+
-`tls.verify`
169
+
-`tls.vhost`
170
+
-`workers`
143
171
144
172
### Run using a configuration file
145
173
146
-
We can load a main configuration file using `-c` option.
147
-
Note: No need to specify a plugins configuration file from command line.
174
+
You can load a main configuration file using `-c` option. You don't need to specify a plugins configuration file from command line.
0 commit comments