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: pipeline/inputs/tcp.md
+36-31Lines changed: 36 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,45 +1,45 @@
1
1
# TCP
2
2
3
-
The **tcp** input plugin allows to retrieve structured JSON or raw messages over a TCP network interface (TCP port).
3
+
The _TCP_ input plugin lets you retrieve structured JSON or raw messages over a TCP network interface (TCP port).
4
4
5
5
## Configuration Parameters
6
6
7
7
The plugin supports the following configuration parameters:
8
8
9
9
| Key | Description | Default |
10
10
| ------------ | ----------- | ------- |
11
-
| Listen | Listener network interface. |0.0.0.0 |
12
-
| Port | TCP port where listening for connections|5170|
13
-
|Buffer\_Size| Specify the maximum buffer size in KB to receive a JSON message. If not set, the default size will be the value of _Chunk\_Size_. ||
14
-
|Chunk\_Size | By default the buffer to store the incoming JSON messages, do not allocate the maximum memory allowed, instead it allocate memory when is required. The rounds of allocations are set by _Chunk\_Size_ in KB. If not set, _Chunk\_Size_ is equal to 32 (32KB). |32 |
15
-
| Format | Specify the expected payload format. It support the options _json_and _none_. When using _json_, it expects JSON maps, when is set to _none_, it will split every record using the defined _Separator_ (option below). |json|
16
-
| Separator| When the expected _Format_is set to _none_, Fluent Bit needs a separator string to split the records. By default it uses the breakline character (LF or 0x10). ||
17
-
|Source\_Address\_Key| Specify the key where the source address will be injected. ||
18
-
| Threaded | Indicates whether to run this input in its own [thread](../../administration/multithreading.md#inputs). |`false`|
|`Port`| TCP port to listen for connections. |`5170`|
13
+
|`Buffer_Size`| Specify the maximum buffer size in KB to receive a JSON message. If not set, the default is the value of `Chunk_Size`. |`Chunk_Size`|
14
+
|`Chunk_Size`| The default buffer to store the incoming JSON messages. It doesn't allocate the maximum memory allowed; instead it allocates memory when required. The rounds of allocations are set by `Chunk_Size`. If not set, `Chunk_Size` is equal to 32 (32KB). |`32`|
15
+
|`Format`| Specify the expected payload format. Supported values: `json`and `none`. When set to `json`it expects JSON maps. When set to `none`, every record splits using the defined `Separator`. |`json`|
16
+
|`Separator`| When `Format`is set to `none`, Fluent Bit needs a separator string to split the records. |`LF` or `0x10` (break line)|
17
+
|`Source_Address_Key`| Specify the key to inject the source address. |_none_|
18
+
|`Threaded`| Indicates whether to run this input in its own [thread](../../administration/multithreading.md#inputs). |`false`|
19
19
20
-
## Getting Started
20
+
## Get started
21
21
22
-
In order to receive JSON messages over TCP, you can run the plugin from the command line or through the configuration file:
22
+
To receive JSON messages over TCP, you can run the plugin from the command line or through the configuration file.
23
23
24
-
### Command Line
24
+
### Command line
25
25
26
-
From the command line you can let Fluent Bit listen for _JSON_ messages with the following options:
26
+
From the command line you can let Fluent Bit listen for JSON messages with the following options:
27
27
28
-
```shell
29
-
$ fluent-bit -i tcp -o stdout
28
+
```bash
29
+
fluent-bit -i tcp -o stdout
30
30
```
31
31
32
-
By default the service will listen an all interfaces (0.0.0.0) through TCP port 5170, optionally you can change this directly, e.g:
32
+
By default the service will listen an all interfaces (`0.0.0.0`) through TCP port `5170`. Optionally you can change this directly:
33
33
34
-
```shell
35
-
$ fluent-bit -i tcp://192.168.3.2:9090 -o stdout
34
+
```bash
35
+
fluent-bit -i tcp://192.168.3.2:9090 -o stdout
36
36
```
37
37
38
-
In the example the JSON messages will only arrive through network interface under 192.168.3.2 address and TCP Port 9090.
38
+
In the example the JSON messages will only arrive through the network interface at `192.168.3.2` address and TCP Port `9090`.
39
39
40
-
### Configuration File
40
+
### Configuration file
41
41
42
-
In your main configuration file append the following _Input_ & _Output_sections:
42
+
In your main configuration file append the following sections:
43
43
44
44
{% tabs %}
45
45
{% tab title="fluent-bit.yaml" %}
@@ -79,21 +79,26 @@ pipeline:
79
79
{% endtab %}
80
80
{% endtabs %}
81
81
82
-
## Testing
82
+
## Test the configuration
83
83
84
-
Once Fluent Bit is running, you can send some messages using the _netcat_:
84
+
When Fluent Bit is running, you can send some messages using `netcat`:
When receiving payloads in JSON format, there are high performance penalties. Parsing JSON is a very expensive task so you could expect your CPU usage increase under high load environments.
124
129
125
-
To get faster data ingestion, consider to use the option `Format none` to avoid JSON parsing if not needed.
130
+
To get faster data ingestion, consider to use the option `Format none` to avoid JSON parsing if not needed.
0 commit comments