Skip to content

Commit ccd1bd7

Browse files
authored
Merge pull request #1729 from fluent/lynettemiles/sc-136181/update-fluent-bit-docs-pipeline-inputs-http
2 parents 8ffc14e + e19367d commit ccd1bd7

File tree

1 file changed

+61
-47
lines changed

1 file changed

+61
-47
lines changed

pipeline/inputs/http.md

Lines changed: 61 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,51 @@
1-
---
2-
description: The HTTP input plugin allows you to send custom records to an HTTP endpoint.
3-
---
41

52
# HTTP
63

7-
## Configuration Parameters
4+
The _HTTP_ input plugin lets Fluent Bit open an HTTP port that you can then route data to in a dynamic way.
85

9-
| **Key** | Description | default |
10-
|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|---------|
11-
| listen | The address to listen on | 0.0.0.0 |
12-
| port | The port for Fluent Bit to listen on | 9880 |
13-
| tag_key | Specify the key name to overwrite a tag. If set, the tag will be overwritten by a value of the key. | |
14-
| buffer_max_size | Specify the maximum buffer size in KB to receive a JSON message. | 4M |
15-
| buffer_chunk_size | This sets the chunk size for incoming JSON messages. These chunks are then stored/managed in the space available by buffer_max_size. | 512K |
16-
| successful_response_code | It allows to set successful response code. `200`, `201` and `204` are supported. | 201 |
17-
| success_header | Add an HTTP header key/value pair on success. Multiple headers can be set. Example: `X-Custom custom-answer` | |
18-
| threaded | Indicates whether to run this input in its own [thread](../../administration/multithreading.md#inputs). | `false` |
6+
## Configuration parameters
7+
8+
| Key | Description | Default |
9+
| --- | ----------- | ------- |
10+
| `listen` | The address to listen on. | `0.0.0.0` |
11+
| `port` | The port for Fluent Bit to listen on. | `9880` |
12+
| `tag_key` | Specify the key name to overwrite a tag. If set, the tag will be overwritten by a value of the key. | _none_ |
13+
| `buffer_max_size` | Specify the maximum buffer size in KB to receive a JSON message. | `4M` |
14+
| `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` |
15+
| `successful_response_code` | Allows setting successful response code. Supported values: `200`, `201`, and `204` | `201` |
16+
| `success_header` | Add an HTTP header key/value pair on success. Multiple headers can be set. For example, `X-Custom custom-answer` | _none_ |
17+
| `threaded` | Indicates whether to run this input in its own [thread](../../administration/multithreading.md#inputs). | `false` |
1918

2019
### TLS / SSL
2120

22-
HTTP input plugin supports TLS/SSL, for more details about the properties available and general configuration, please refer to the [Transport Security](../../administration/transport-security.md) section.
21+
HTTP input plugin supports TLS/SSL. For more details about the properties available and general configuration, refer to [Transport Security](../../administration/transport-security.md).
2322

2423
### gzipped content
2524

26-
The HTTP input plugin will accept and automatically handle gzipped content as of v2.2.1 as long as the header `Content-Encoding: gzip` is set on the received data.
25+
The HTTP input plugin will accept and automatically handle gzipped content in version 2.2.1 or later if the header `Content-Encoding: gzip` is set on the received data.
2726

28-
## Getting Started
27+
## Get started
2928

30-
The http input plugin allows Fluent Bit to open up an HTTP port that you can then route data to in a dynamic way. This plugin supports dynamic tags which allow you to send data with different tags through the same input. An example video and curl message can be seen below
29+
This plugin supports dynamic tags which let you send data with different tags through the same input. See the following for an example:
3130

3231
[Link to video](https://asciinema.org/a/375571)
3332

34-
#### How to set tag
33+
### Set a tag
3534

3635
The tag for the HTTP input plugin is set by adding the tag to the end of the request URL. This tag is then used to route the event through the system.
37-
For example, in the following curl message below the tag set is `app.log**. **` because the end path is `/app_log`:
3836

39-
### Curl request
37+
For example, in the following curl message the tag set is `app.log**. **` because the end path is `/app_log`:
4038

41-
```
39+
```shell
4240
curl -d '{"key1":"value1","key2":"value2"}' -XPOST -H "content-type: application/json" http://localhost:8888/app.log
4341
```
4442

45-
### Configuration File
43+
### Configuration file
4644

4745
{% tabs %}
4846
{% tab title="fluent-bit.conf" %}
49-
```
47+
48+
```python
5049
[INPUT]
5150
name http
5251
listen 0.0.0.0
@@ -56,9 +55,11 @@ curl -d '{"key1":"value1","key2":"value2"}' -XPOST -H "content-type: application
5655
name stdout
5756
match app.log
5857
```
58+
5959
{% endtab %}
6060

6161
{% tab title="fluent-bit.yaml" %}
62+
6263
```yaml
6364
pipeline:
6465
inputs:
@@ -69,22 +70,22 @@ pipeline:
6970
- name: stdout
7071
match: app.log
7172
```
73+
7274
{% endtab %}
7375
{% endtabs %}
7476
75-
If you do not set the tag `http.0` is automatically used. If you have multiple HTTP inputs then they will follow a pattern of `http.N` where N is an integer representing the input.
77+
### Configuration file `http.0` example
7678

77-
### Curl request
79+
If you don't set the tag, `http.0` is automatically used. If you have multiple HTTP inputs then they will follow a pattern of `http.N` where `N` is an integer representing the input.
7880

79-
```
81+
```shell
8082
curl -d '{"key1":"value1","key2":"value2"}' -XPOST -H "content-type: application/json" http://localhost:8888
8183
```
8284

83-
### Configuration File
84-
8585
{% tabs %}
8686
{% tab title="fluent-bit.conf" %}
87-
```
87+
88+
```python
8889
[INPUT]
8990
name http
9091
listen 0.0.0.0
@@ -94,9 +95,11 @@ curl -d '{"key1":"value1","key2":"value2"}' -XPOST -H "content-type: application
9495
name stdout
9596
match http.0
9697
```
98+
9799
{% endtab %}
98100

99101
{% tab title="fluent-bit.yaml" %}
102+
100103
```yaml
101104
pipeline:
102105
inputs:
@@ -107,25 +110,26 @@ pipeline:
107110
- name: stdout
108111
match: http.0
109112
```
113+
110114
{% endtab %}
111115
{% endtabs %}
112116

113-
#### How to set tag_key
117+
#### Set `tag_key`
114118

115-
The tag_key configuration option allows to specify the key name that will be used to overwrite a tag. The tag's value will be replaced with the value associated with the specified key. For example, setting tag_key to "custom_tag" and the log event contains a json field with the key "custom_tag" Fluent Bit will use the value of that field as the new tag for routing the event through the system.
119+
The `tag_key` configuration option lets you specify the key name that will be used to overwrite a tag. The tag's value will be replaced with the value associated with the specified key. For example, setting `tag_key` to `custom_tag` and the log event contains a JSON field with the key `custom_tag`. Fluent Bit will use the value of that field as the new tag for routing the event through the system.
116120

117121
### Curl request
118122

119-
```
123+
```shell
120124
curl -d '{"key1":"value1","key2":"value2"}' -XPOST -H "content-type: application/json" http://localhost:8888/app.log
121125
```
122126

123-
### Configuration File
124-
127+
### Configuration file `tag_key` example
125128

126129
{% tabs %}
127130
{% tab title="fluent-bit.conf" %}
128-
```
131+
132+
```python
129133
[INPUT]
130134
name http
131135
listen 0.0.0.0
@@ -136,9 +140,11 @@ curl -d '{"key1":"value1","key2":"value2"}' -XPOST -H "content-type: application
136140
name stdout
137141
match value1
138142
```
143+
139144
{% endtab %}
140145

141146
{% tab title="fluent-bit.yaml" %}
147+
142148
```yaml
143149
pipeline:
144150
inputs:
@@ -150,45 +156,50 @@ pipeline:
150156
- name: stdout
151157
match: value1
152158
```
159+
153160
{% endtab %}
154161
{% endtabs %}
155162

156-
#### How to set multiple custom HTTP header on success
163+
#### Set multiple custom HTTP headers on success
157164

158-
The `success_header` parameter allows to set multiple HTTP headers on success. The format is:
165+
The `success_header` parameter lets you set multiple HTTP headers on success. The format is:
159166

160167
{% tabs %}
161168
{% tab title="fluent-bit.conf" %}
162-
```ini
169+
170+
```python
163171
[INPUT]
164172
name http
165173
success_header X-Custom custom-answer
166174
success_header X-Another another-answer
167175
```
176+
168177
{% endtab %}
169178

170179
{% tab title="fluent-bit.yaml" %}
180+
171181
```yaml
172182
inputs:
173183
- name: http
174184
success_header: X-Custom custom-answer
175185
success_header: X-Another another-answer
176186
```
187+
177188
{% endtab %}
178189
{% endtabs %}
179190

191+
#### Example curl message
180192

181-
#### Example Curl message
182-
183-
```
193+
```shell
184194
curl -d @app.log -XPOST -H "content-type: application/json" http://localhost:8888/app.log
185195
```
186196

187-
### Configuration File
197+
### Configuration file example 3
188198

189199
{% tabs %}
190200
{% tab title="fluent-bit.conf" %}
191-
```
201+
202+
```python
192203
[INPUT]
193204
name http
194205
listen 0.0.0.0
@@ -198,9 +209,11 @@ curl -d @app.log -XPOST -H "content-type: application/json" http://localhost:888
198209
name stdout
199210
match *
200211
```
212+
201213
{% endtab %}
202214

203215
{% tab title="fluent-bit.yaml" %}
216+
204217
```yaml
205218
pipeline:
206219
inputs:
@@ -212,11 +225,12 @@ pipeline:
212225
- name: stdout
213226
match: '*'
214227
```
228+
215229
{% endtab %}
216230
{% endtabs %}
217231

218-
### Command Line
232+
### Command line
219233

220-
```
221-
$> fluent-bit -i http -p port=8888 -o stdout
234+
```shell
235+
fluent-bit -i http -p port=8888 -o stdout
222236
```

0 commit comments

Comments
 (0)