Skip to content

Added YAML examples to the networking docs. Fixes #1744. #1745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions administration/networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,38 @@ that rely on networking I/O:
This example sends five random messages through a TCP output connection. The remote
side uses the `nc` (netcat) utility to see the data.

Put the following configuration snippet in a file called `fluent-bit.conf`:
Use the following configuration snippet of your choice in a corresponding file named `fluent-bit.yaml` or `fluent-bit.conf`:

{% tabs %}
{% tab title="fluent-bit.yaml" %}

```yaml
service:
flush: 1
log_level: info

pipeline:
inputs:
- name: random
samples: 5

outputs:
- name: tcp
match: '*'
host: 127.0.0.1
port: 9090
format: json_lines
# Networking Setup
net.dns.mode: TCP
net.connect_timeout: 5
net.source_address: 127.0.0.1
net.keepalive: on
net.keepalive_idle_timeout: 10
```

{% endtab %}

{% tab title="fluent-bit.conf" %}

```text
[SERVICE]
Expand All @@ -120,6 +151,9 @@ Put the following configuration snippet in a file called `fluent-bit.conf`:
net.keepalive_idle_timeout 10
```

{% endtab %}
{% endtabs %}

In another terminal, start `nc` and make it listen for messages on TCP port 9090:

```text
Expand All @@ -142,4 +176,4 @@ If the `net.keepalive` option isn't enabled, Fluent Bit closes the TCP connectio
and netcat quits.

After the five records arrive, the connection idles. After 10 seconds, the connection
closes due to `net.keepalive_idle_timeout`.
closes due to `net.keepalive_idle_timeout`.