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
|`buffer_chunk_size`| This sets the chunk size for incoming JSON messages. These chunks are then stored and managed in the space available by `buffer_max_size`. |`512K`|
11
-
|`buffer_max_size`| Specify the maximum buffer size to receive a JSON message. |`4M`|
12
-
|`http2`| Enable HTTP/2 support. |`true`|
13
-
|`listen`| The address to listen on. |`0.0.0.0`|
14
-
|`port`| The port for Fluent Bit to listen on. |`9880`|
15
-
|`success_header`| Add an HTTP header key/value pair on success. Multiple headers can be set. For example, `X-Custom custom-answer`. |_none_|
|`add_remote_addr`| Adds a `REMOTE_ADDR` field to the record. The value of `REMOTE_ADDR` is the client's address, which is extracted from the `X-Forwarded-For` header. |`false`|
11
+
|`buffer_chunk_size`| This sets the chunk size for incoming JSON messages. These chunks are then stored and managed in the space available by `buffer_max_size`. |`512K`|
12
+
|`buffer_max_size`| Specify the maximum buffer size to receive a JSON message. |`4M`|
13
+
|`http2`| Enable HTTP/2 support. |`true`|
14
+
|`listen`| The address to listen on. |`0.0.0.0`|
15
+
|`port`| The port for Fluent Bit to listen on. |`9880`|
16
+
|`success_header`| Add an HTTP header key/value pair on success. Multiple headers can be set. For example, `X-Custom custom-answer`. |_none_|
The `add_remote_addr` configuration option, when activated, adds a `REMOTE_ADDR` field to the records. The value of `REMOTE_ADDR` is the client's address, which is extracted from the `X-Forwarded-For` header.
48
+
49
+
In most cases, only a single `X-Forwarded-For` header is in the request, so the following curl would add a `REMOTE_ADDR` field which would be set to `host1`:
However, if your system sets multiple `X-Forwarded-For` headers in the request, the one used (first, or last) depends on the value of the `http2` config. For example:
56
+
57
+
Assuming the following X-Forwarded-For headers are in the request:
58
+
59
+
```text
60
+
X-Forwarded-For: host1, host2
61
+
X-Forwarded-For: host3, host4
62
+
```
63
+
64
+
The value of REMOTE_ADDR will be:
65
+
66
+
| http2 config | value of REMOTE_ADDR |
67
+
|------------------|----------------------|
68
+
|`true` (default) | host3 |
69
+
|`false`| host1 |
70
+
44
71
### Configuration file
45
72
46
73
{% tabs %}
@@ -161,6 +188,47 @@ pipeline:
161
188
{% endtab %}
162
189
{% endtabs %}
163
190
191
+
#### Set `add_remote_addr`
192
+
193
+
The `add_remote_addr` configuration option lets you activate a feature that systematically adds the `REMOTE_ADDR` field to events, and set its value to the client's address. The address will be extracted from the `X-Forwarded-For` header of the request. The format is:
0 commit comments