|
6 | 6 |
|
7 | 7 | [Fluent Bit](http://fluentbit.io) runs as a service, meaning that the API exposed for developers provide interfaces to create and manage a context, specify inputs/outputs, set configuration parameters and set routing paths for the event/records. A typical usage of the library involves:
|
8 | 8 |
|
9 |
| -- Create library instance/context. |
| 9 | +- Create library instance/context and set properties. |
10 | 10 | - Enable _input_ plugin(s) instances and set properties.
|
11 | 11 | - Enable _output_ plugin(s) instances and set properties.
|
12 | 12 | - Start the library runtime.
|
@@ -53,6 +53,34 @@ if (!ctx) {
|
53 | 53 | }
|
54 | 54 | ```
|
55 | 55 |
|
| 56 | +### Set Service Properties |
| 57 | + |
| 58 | +Using the __flb_service_set()__ function is possible to set context properties. |
| 59 | + |
| 60 | +__Prototype__ |
| 61 | + |
| 62 | +```C |
| 63 | +int flb_service_set(flb_ctx_t *ctx, ...); |
| 64 | +``` |
| 65 | +
|
| 66 | +__Return Value__ |
| 67 | +
|
| 68 | +On success it returns 0; on error it returns a negative number. |
| 69 | +
|
| 70 | +__Usage__ |
| 71 | +
|
| 72 | +The __flb_service_set()__ allows to set one or more properties in a key/value string mode, e.g: |
| 73 | +
|
| 74 | +```C |
| 75 | +int ret; |
| 76 | +
|
| 77 | +ret = flb_service_set(ctx, "Flush", "1", NULL); |
| 78 | +
|
| 79 | +``` |
| 80 | + |
| 81 | +The above example specified the values for the properties __Flush__ , note that the value is always a string (char *) and once there is no more parameters a NULL argument must be added at the end of the list. |
| 82 | + |
| 83 | + |
56 | 84 | ### Enable Input Plugin Instance
|
57 | 85 |
|
58 | 86 | When built, [Fluent Bit](http://fluentbit.io) library contains a certain number of built-in _input_ plugins. In order to enable an _input_ plugin, the function __flb_input__() is used to create an instance of it.
|
@@ -97,7 +125,7 @@ On success it returns 0; on error it returns a negative number.
|
97 | 125 |
|
98 | 126 | __Usage__
|
99 | 127 |
|
100 |
| -The __flb_input_set()__ allow to set one or more properties in a key/value string mode, e.g: |
| 128 | +The __flb_input_set()__ allows to set one or more properties in a key/value string mode, e.g: |
101 | 129 |
|
102 | 130 | ```C
|
103 | 131 | int ret;
|
@@ -156,7 +184,7 @@ On success it returns 0; on error it returns a negative number.
|
156 | 184 |
|
157 | 185 | __Usage__
|
158 | 186 |
|
159 |
| -The __flb_output_set()__ allow to set one or more properties in a key/value string mode, e.g: |
| 187 | +The __flb_output_set()__ allows to set one or more properties in a key/value string mode, e.g: |
160 | 188 |
|
161 | 189 | ```C
|
162 | 190 | int ret;
|
|
0 commit comments