Standard Input
The stdin plugin allows to retrieve valid JSON text messages over the standard input interface (stdin). In order to use it, specify the plugin name as the input, e.g:
1
$ fluent-bit -i stdin -o stdout
Copied!
As input data the stdin plugin recognize the following JSON data formats:
1
1. { map => val, map => val, map => val }
2
2. [ time, { map => val, map => val, map => val } ]
Copied!
A better example to demonstrate how it works will be through a Bash script that generates messages and writes them to Fluent Bit. Write the following content in a file named test.sh:
1
#!/bin/sh
2
3
while :; do
4
echo -n "{\"key\": \"some value\"}"
5
sleep 1
6
done
Copied!
Give the script execution permission:
1
$ chmod 755 test.sh
Copied!
Now lets start the script and Fluent Bit in the following way:
1
$ ./test.sh | fluent-bit -i stdin -o stdout
2
Fluent Bit v1.x.x
3
* Copyright (C) 2019-2020 The Fluent Bit Authors
4
* Copyright (C) 2015-2018 Treasure Data
5
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
6
* https://fluentbit.io
7
8
[2016/10/07 21:44:46] [ info] [engine] started
9
[0] stdin.0: [1475898286, {"key"=>"some value"}]
10
[1] stdin.0: [1475898287, {"key"=>"some value"}]
11
[2] stdin.0: [1475898288, {"key"=>"some value"}]
12
[3] stdin.0: [1475898289, {"key"=>"some value"}]
13
[4] stdin.0: [1475898290, {"key"=>"some value"}]
Copied!

Configuration Parameters

The plugin supports the following configuration parameters:
Key
Description
Default
Buffer_Size
Set the buffer size to read data. This value is used to increase buffer size. The value must be according to the Unit Size specification.
16k
Last modified 1mo ago
Export as PDF
Copy link