Skip to content

Commit 6858d2c

Browse files
committed
Merge branch 'master' of github.com:fluent/fluent-bit
2 parents 7fd3c10 + e845fa6 commit 6858d2c

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ $ make
1919
When building _Fluent-Bit_, the following options are available when running __cmake__:
2020

2121
option | value type | description | default
22-
------------|------------|---------------------------------------------|---------
23-
WITH_ALL | bool | Enable all features available | off
24-
WITH_XBEE | bool | Enable XBee support (input) | off
25-
WITH_DEBUG | bool | Include debug symbols when building targets | off
26-
WITHOUT_BIN | bool | Do not build the fluent-bit executable | off
22+
-------------|------------|---------------------------------------------|---------
23+
WITH_ALL | bool | Enable all features available | off
24+
WITH_IN_XBEE | bool | Enable XBee support (input) | off
25+
WITH_DEBUG | bool | Include debug symbols when building targets | off
26+
WITHOUT_BIN | bool | Do not build the fluent-bit executable | off
2727

2828
In order to active one of these features, you need to set a boolean value. As an example if we would like to build _Fluent-Bit_ with _XBee_ support we should do:
2929

3030
```bash
3131
$ cd build/
32-
$ cmake -DWITH_XBEE=1 ..
32+
$ cmake -DWITH_IN_XBEE=1 ..
3333
$ make
3434
```
3535

@@ -46,11 +46,11 @@ Once the tool have been compiled, a binary file called _Fluent-Bit_ will be foun
4646
| CPU | cpu | gather CPU usage between snapshots of one second. It support multiple cores |
4747
| Memory | mem | usage of system memory |
4848
| Kernel Ring Buffer | kmsg | read Linux Kernel messages, same behavior as the __dmesg__ command line program |
49-
| XBee | xbee | listen for incoming messages over a Xbee device |
49+
| XBee | xbee | listen for incoming messages over a Xbee device |
5050

5151
### Output Plugins
5252

53-
| name | option | description |
53+
| name | option | description |
5454
|--------------------|-------------------------|---------------------------------------------------------------------------------|
5555
| Fluentd | fluentd://host:port | flush content to a [Fluentd](http://fluentd.org) service. On the [Fluentd](http://fluentd.org) side, it requires an __in_forward__.|
5656
| TreasureData | td | flush data collected to [TreasureData](http://treasuredata.com) service (cloud analytics platform) |

plugins/in_cpu/in_cpu.c

+3
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ void *in_cpu_flush(void *in_context, int *size)
158158
msgpack_sbuffer *sbuf;
159159
struct flb_in_cpu_config *ctx = in_context;
160160

161+
if (ctx->data_idx == 0)
162+
return NULL;
163+
161164
sbuf = &ctx->mp_sbuf;
162165
*size = sbuf->size;
163166
buf = malloc(sbuf->size);

plugins/in_kmsg/in_kmsg.c

+3
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ void *in_kmsg_flush(void *in_context, int *size)
107107
msgpack_sbuffer *sbuf;
108108
struct flb_in_kmsg_config *ctx = in_context;
109109

110+
if (ctx->buffer_id == 0)
111+
return NULL;
112+
110113
sbuf = &ctx->mp_sbuf;
111114
*size = sbuf->size;
112115
buf = malloc(sbuf->size);

plugins/in_mem/in_mem.c

+3
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ void *in_mem_flush(void *in_context, int *size)
9999
char *buf;
100100
struct flb_in_mem_config *ctx = in_context;
101101

102+
if (ctx->idx == 0)
103+
return NULL;
104+
102105
buf = malloc(ctx->sbuf.size);
103106
if (!buf) {
104107
return NULL;

0 commit comments

Comments
 (0)