Skip to content

Commit ea27e26

Browse files
authored
Added YAML examples to the networking docs. Fixes #1744. (#1745)
Signed-off-by: Eric D. Schabell <[email protected]>
1 parent b674883 commit ea27e26

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

administration/networking.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,38 @@ that rely on networking I/O:
9595
This example sends five random messages through a TCP output connection. The remote
9696
side uses the `nc` (netcat) utility to see the data.
9797

98-
Put the following configuration snippet in a file called `fluent-bit.conf`:
98+
Use the following configuration snippet of your choice in a corresponding file named `fluent-bit.yaml` or `fluent-bit.conf`:
99+
100+
{% tabs %}
101+
{% tab title="fluent-bit.yaml" %}
102+
103+
```yaml
104+
service:
105+
flush: 1
106+
log_level: info
107+
108+
pipeline:
109+
inputs:
110+
- name: random
111+
samples: 5
112+
113+
outputs:
114+
- name: tcp
115+
match: '*'
116+
host: 127.0.0.1
117+
port: 9090
118+
format: json_lines
119+
# Networking Setup
120+
net.dns.mode: TCP
121+
net.connect_timeout: 5
122+
net.source_address: 127.0.0.1
123+
net.keepalive: on
124+
net.keepalive_idle_timeout: 10
125+
```
126+
127+
{% endtab %}
128+
129+
{% tab title="fluent-bit.conf" %}
99130
100131
```text
101132
[SERVICE]
@@ -120,6 +151,9 @@ Put the following configuration snippet in a file called `fluent-bit.conf`:
120151
net.keepalive_idle_timeout 10
121152
```
122153

154+
{% endtab %}
155+
{% endtabs %}
156+
123157
In another terminal, start `nc` and make it listen for messages on TCP port 9090:
124158

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

144178
After the five records arrive, the connection idles. After 10 seconds, the connection
145-
closes due to `net.keepalive_idle_timeout`.
179+
closes due to `net.keepalive_idle_timeout`.

0 commit comments

Comments
 (0)