The nats output plugin, allows to flush your records into a NATS Server end point. The following instructions assumes that you have a fully operational NATS Server in place.
Configuration parameters
parameter
description
default
host
IP address or hostname of the NATS Server
127.0.0.1
port
TCP port of the target NATS Server
4222
workers
The number of workers to perform flush operations for this output.
0
In order to override the default configuration values, the plugin uses the optional Fluent Bit network address format, e.g:
nats://host:port
Running
Fluent Bit only requires to know that it needs to use the nats output plugin, if no extra information is given, it will use the default values specified in the above table.
$bin/fluent-bit-icpu-onats-V-f5FluentBitv1.x.x* Copyright (C) 2019-2020 The Fluent Bit Authors* Copyright (C) 2015-2018 Treasure Data* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd* https://fluentbit.io[2016/03/04 10:17:33] [ info] Configurationflushtime:5secondsinputplugins:cpucollectors:[2016/03/04 10:17:33] [ info] starting enginecpu[all]all=3.250000user=2.500000system=0.750000cpu[i=0]all=3.000000user=1.000000system=2.000000cpu[i=1]all=3.000000user=2.000000system=1.000000cpu[i=2]all=2.000000user=2.000000system=0.000000cpu[i=3]all=6.000000user=5.000000system=1.000000[2016/03/04 10:17:33] [debug] [in_cpu] CPU 3.25%...
As described above, the target service and storage point can be changed, e.g:
Data format
For every set of records flushed to a NATS Server, Fluent Bit uses the following JSON format:
Each record is an individual entity represented in a JSON array that contains a UNIX_TIMESTAMP and a JSON map with a set of key/values. A summarized output of the CPU input plugin will looks as this: