Skip to content

Commit c651427

Browse files
authored
Merge pull request #1839 from fluent/lynettemiles/sc-136209/update-fluent-bit-docs-pipeline-inputs-udp
2 parents 69f8ffa + d36bb2d commit c651427

File tree

1 file changed

+38
-34
lines changed

1 file changed

+38
-34
lines changed

pipeline/inputs/udp.md

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
# UDP
22

3-
The **udp** input plugin allows to retrieve structured JSON or raw messages over a UDP network interface (UDP port).
3+
The _UDP_ input plugin lets you retrieve structured JSON or raw messages over a UDP network interface (UDP port).
44

5-
## Configuration Parameters
5+
## Configuration parameters
66

77
The plugin supports the following configuration parameters:
88

9-
| Key | Description | Default |
10-
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
11-
| Listen | Listener network interface. | 0.0.0.0 |
12-
| Port | UDP 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` |
9+
| Key | Description | Default |
10+
| --- | ----------- | ------- |
11+
| `Listen` | Listener network interface. | `0.0.0.0` |
12+
| `Port` | UDP port used 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 size will be the value of `Chunk_Size`. | `Chunk_Size` (value) |
14+
| `Chunk_Size` | The default buffer to store incoming JSON messages. Doesn't allocate the maximum memory allowed; instead it allocates memory when required. The rounds of allocations are set by `Chunk_Size` in KB. | `32` |
15+
| `Format` | Specify the expected payload format. Supported values: `json` and `none`. `json` expects JSON maps. `none` splits every record 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 where the source address will be injected. | _none_ |
18+
| `Threaded` | Indicates whether to run this input in its own [thread](../../administration/multithreading.md#inputs). | `false` |
1919

20-
## Getting Started
20+
## Get started
2121

22-
In order to receive JSON messages over UDP, you can run the plugin from the command line or through the configuration file:
22+
To receive JSON messages over UDP, you can run the plugin from the command line or through the configuration file.
2323

24-
### Command Line
24+
### Command line
2525

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:
2727

28-
```shell
29-
$ ./fluent-bit -i udp -o stdout
28+
```bash
29+
fluent-bit -i udp -o stdout
3030
```
3131

32-
By default the service will listen an all interfaces (0.0.0.0) through UDP port 5170, optionally you can change this directly, e.g:
32+
By default, the service listens on all interfaces (`0.0.0.0`) using UDP port `5170`. Optionally. you can change this directly.
3333

34-
```shell
35-
$ ./fluent-bit -i udp -port=9090 -o stdout
36-
```
34+
In this example the JSON messages will only arrive through network interface at `192.168.3.2` address and UDP Port `9090`.
3735

38-
In the example the JSON messages will only arrive through network interface under 192.168.3.2 address and UDP Port 9090.
36+
```bash
37+
fluent-bit -i udp -pport=9090 -o stdout
38+
```
3939

40-
### Configuration File
40+
### Configuration file
4141

4242
In your main configuration file append the following:
4343

@@ -81,19 +81,23 @@ pipeline:
8181

8282
## Testing
8383

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`:
8585

86-
```shell
87-
$ echo '{"key 1": 123456789, "key 2": "abcdefg"}' | nc -u 127.0.0.1 5170
86+
```bash
87+
echo '{"key 1": 123456789, "key 2": "abcdefg"}' | nc -u 127.0.0.1 5170
8888
```
8989

90-
In [Fluent Bit](http://fluentbit.io) we should see the following output:
90+
Run Fluent Bit:
9191

92-
```shell
93-
$ ./fluent-bit -i udp -o stdout -f 1
92+
```bash
93+
bin/fluent-bit -i udp -o stdout -f 1
94+
```
9495

95-
Fluent Bit v4.0.3
96-
* Copyright (C) 2015-2025 The Fluent Bit Authors
96+
You should see the following output:
97+
98+
```text
99+
Fluent Bit v2.x.x
100+
* Copyright (C) 2015-2022 The Fluent Bit Authors
97101
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
98102
* https://fluentbit.io
99103
@@ -118,8 +122,8 @@ ______ _ _ ______ _ _ ___ _____
118122
[0] udp.0: [[1689912069.078189000, {}], {"key 1"=>123456789, "key 2"=>"abcdefg"}]
119123
```
120124

121-
## Performance Considerations
125+
## Performance considerations
122126

123127
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.
124128

125-
To get faster data ingestion, consider to use the option `Format none` to avoid JSON parsing if not needed.
129+
To get faster data ingestion, consider using the option `Format none` to avoid JSON parsing if not needed.

0 commit comments

Comments
 (0)