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
Copy file name to clipboardExpand all lines: pipeline/outputs/http.md
+54-50Lines changed: 54 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,52 +1,54 @@
1
1
# HTTP
2
2
3
-
The **http** output plugin allows to flush your records into an HTTP endpoint. For now the functionality is pretty basic, and it issues a POST request with the data records in [MessagePack](http://msgpack.org) (or JSON) format.
| AWS\_Service | Specify the AWS service code, i.e. es, xray, etc., of your service, used by SigV4 authentication. Usually can be found in the service endpoint's subdomains, `protocol://service-code.region-code.amazonaws.com`||
14
-
| AWS\_Region | Specify the AWS region of your service, used by SigV4 authentication ||
15
-
| AWS\_STS\_Endpoint | Specify the custom sts endpoint to be used with STS API, used with the AWS_Role_ARN option, used by SigV4 authentication ||
16
-
| AWS\_Role\_ARN | AWS IAM Role to assume, used by SigV4 authentication ||
17
-
| AWS\_External\_ID | External ID for the AWS IAM Role specified with `aws_role_arn`, used by SigV4 authentication ||
18
-
| port | TCP port of the target HTTP Server | 80 |
19
-
| Proxy | Specify an HTTP Proxy. The expected format of this value is `http://HOST:PORT`. Note that HTTPS is **not** currently supported. It is recommended not to set this and to configure the [HTTP proxy environment variables](https://docs.fluentbit.io/manual/administration/http-proxy) instead as they support both HTTP and HTTPS. ||
20
-
| uri | Specify an optional HTTP URI for the target web server, e.g: /something | / |
21
-
| compress | Set payload compression mechanism. Option available is 'gzip' ||
22
-
| format | Specify the data format to be used in the HTTP request body, by default it uses _msgpack_. Other supported formats are _json_, _json\_stream_ and _json\_lines_ and _gelf_. | msgpack |
23
-
| allow\_duplicated\_headers | Specify if duplicated headers are allowed. If a duplicated header is found, the latest key/value set is preserved. | true |
24
-
| log\_response\_payload | Specify if the response payload should be logged or not. | true |
25
-
| header\_tag | Specify an optional HTTP header field for the original message tag. ||
26
-
| header | Add a HTTP header key/value pair. Multiple headers can be set. ||
27
-
| json\_date\_key | Specify the name of the time key in the output record. To disable the time key just set the value to `false`. | date |
28
-
| json\_date\_format | Specify the format of the date. Supported formats are _double_, _epoch_, _iso8601_ (eg: _2018-05-30T09:39:52.000681Z_) and _java_sql_timestamp_ (eg: _2018-05-30 09:39:52.000681_) | double |
29
-
| gelf\_timestamp\_key | Specify the key to use for `timestamp` in _gelf_ format ||
30
-
| gelf\_host\_key | Specify the key to use for the `host` in _gelf_ format ||
31
-
| gelf\_short\_message\_key | Specify the key to use as the `short` message in _gelf_ format ||
32
-
| gelf\_full\_message\_key | Specify the key to use for the `full` message in _gelf_ format ||
33
-
| gelf\_level\_key | Specify the key to use for the `level` in _gelf_ format ||
34
-
| body\_key | Specify the key to use as the body of the request (must prefix with "$"). The key must contain either a binary or raw string, and the content type can be specified using headers\_key (which must be passed whenever body\_key is present). When this option is present, each msgpack record will create a separate request. ||
35
-
| headers\_key | Specify the key to use as the headers of the request (must prefix with "$"). The key must contain a map, which will have the contents merged on the request headers. This can be used for many purposes, such as specifying the content-type of the data contained in body\_key. ||
36
-
| workers | The number of [workers](../../administration/multithreading.md#outputs) to perform flush operations for this output. |`2`|
3
+
The _HTTP_ output plugin lets you flush your records into an HTTP endpoint. It issues a POST request with the data records in [MessagePack](http://msgpack.org) (or JSON) format.
4
+
5
+
## Configuration parameters
6
+
7
+
The plugin supports the following configuration parameters:
8
+
9
+
| Key | Description | Default |
10
+
| --- | ----------- | -------- |
11
+
|`host`| IP address or hostname of the target HTTP Server. |`127.0.0.1`|
12
+
|`http_User`| Basic Auth username. |_none_|
13
+
|`http_Passwd`| Basic Auth password. Requires `HTTP_User` to be set. |_none_|
|`AWS_Service`| Specify the AWS service code of your service, used by SigV4 authentication (for example, `es`, `xray`.) Usually found in the service endpoint's subdomains, `protocol://service-code.region-code.amazonaws.com`. |_none_|
16
+
|`AWS_Region`| Specify the AWS region of your service, used by SigV4 authentication. |_none_|
17
+
|`AWS_STS_Endpoint`| Specify the custom STS endpoint to be used by STS API. Used with the `AWS_Role_ARN option` and by SigV4 authentication. |_none_|
18
+
|`AWS_Role_ARN`| AWS IAM Role to assume, used by SigV4 authentication. |_none_|
19
+
|`AWS_External_ID`| External ID for the AWS IAM Role specified with `aws_role_arn`, used by SigV4 authentication. |_none_|
20
+
|`port`| TCP port of the target HTTP Server. |`80`|
21
+
|`Proxy`| Specify an HTTP Proxy. The expected format of this value is `http://HOST:PORT`. HTTPS isn't supported. It's recommended to configure the [HTTP proxy environment variables](https://docs.fluentbit.io/manual/administration/http-proxy) instead as they support both HTTP and HTTPS. |_none_|
22
+
|`uri`| Specify an optional HTTP URI for the target web server. For example, `/somepath`. |`/`|
23
+
|`compress`| Set payload compression mechanism. Allowed value: `gzip`. |_none_|
24
+
|`format`| Specify the data format to be used in the HTTP request body. Supported formats: `gelf`, `json`, `json_stream`, `json_lines`, `msgpack`. |`msgpack`|
25
+
|`allow_duplicated_headers`| Specify if duplicated headers are allowed. If a duplicated header is found, the latest key/value set is preserved. |`true`|
26
+
|`log_response_payload`| Specify if the response payload should be logged or not. |`true`|
27
+
|`header_tag`| Specify an optional HTTP header field for the original message tag. |_none_|
28
+
|`header`| Add a HTTP header key/value pair. Multiple headers can be set. |_none_|
29
+
|`json_date_key`| Specify the name of the time key in the output record. To disable the time key, set the value to `false`. |`date`|
30
+
|`json_date_format`| Specify the format of the date. Supported formats: `double`, `epoch`, `iso8601`, `java_sql_timestamp`. |`double`|
31
+
|`gelf_timestamp_key`| Specify the key to use for `timestamp` in `gelf` format. |_none_|
32
+
|`gelf_host_key`| Specify the key to use for the `host` in `gelf` format. |_none_|
33
+
|`gelf_short_message_key`| Specify the key to use as the `short` message in `gelf` format. |_none_|
34
+
|`gelf_full_message_key`| Specify the key to use for the `full` message in `gelf` format. |_none_|
35
+
|`gelf_level_key`| Specify the key to use for the `level` in `gelf` format. |_none_|
36
+
|`body_key`| Specify the key to use as the body of the request (must prefix with `$`). The key must contain either a binary or raw string, and the content type can be specified using `headers_key`, which must be passed whenever `body_key` is present. When this option is present, each `msgpack` record will create a separate request. |_none_|
37
+
|`headers_key`| Specify the key to use as the headers of the request (must prefix with `$`). The key must contain a map, which will have the contents merged on the request headers. This can be used for many purposes, such as specifying the content type of the data contained in `body_key`.|_none_|
38
+
|`workers`| The number of [workers](../../administration/multithreading.md#outputs) to perform flush operations for this output. |`2`|
37
39
38
40
### TLS / SSL
39
41
40
42
The HTTP output plugin supports TLS/SSL.
41
43
For more details about the properties available and general configuration, see [TLS/SSL](../../administration/transport-security.md).
42
44
43
-
## Getting Started
45
+
## Get started
44
46
45
-
In order to insert records into an HTTP server, you can run the plugin from the command line or through the configuration file:
47
+
To insert records into an HTTP server, you can run the plugin from the command line or through the configuration file.
46
48
47
-
### Command Line
49
+
### Command line
48
50
49
-
The **http** plugin, can read the parameters from the command line in two ways, through the **-p** argument (property) or setting them directly through the service URI. The URI format is the following:
51
+
The HTTP plugin can read the parameters from the command line through the `-p` argument (property) or setting them directly through the service URI. The URI format is the following:
50
52
51
53
```text
52
54
http://host:port/something
@@ -58,7 +60,7 @@ Using the format specified, you could start Fluent Bit through:
58
60
fluent-bit -i cpu -t cpu -o http://192.168.2.3:80/something -m '*'
59
61
```
60
62
61
-
### Configuration File
63
+
### Configuration file
62
64
63
65
In your main configuration file append the following:
64
66
@@ -97,18 +99,18 @@ pipeline:
97
99
{% endtab %}
98
100
{% endtabs %}
99
101
100
-
By default, the URI becomes tag of the message, the original tag is ignored. To retain the tag, multiple configuration sections have to be made based and flush to different URIs.
102
+
By default, the URI becomes tag of the message, the original tag is ignored. To retain the tag, multiple configuration sections have to be made based and flush to more than one URI.
101
103
102
-
Another approach we also support is the sending the original message tag in a configurable header. It's up to the receiver to do what it wants with that header field: parse it and use it as the tag for example.
104
+
Another supported approach is the sending the original message tag in a configurable header. It's up to the receiver to do what it wants with that header field. For example, parse it and use it as the tag for example.
103
105
104
-
To configure this behaviour, add this config:
106
+
To configure this behaviour, add this configuration:
105
107
106
108
{% tabs %}
107
109
{% tab title="fluent-bit.yaml" %}
108
110
109
111
```yaml
110
112
pipeline:
111
-
113
+
112
114
outputs:
113
115
- name: http
114
116
match: '*'
@@ -155,16 +157,18 @@ Provided you are using Fluentd as data receiver, you can combine `in_http` and `
155
157
</match>
156
158
```
157
159
158
-
Notice how we override the tag, which is from URI path, with our custom header
160
+
Fluent Bit overrides the tag, which is from URI path, with a custom header.
161
+
162
+
#### Add a header
159
163
160
-
#### Example : Add a header
164
+
This example adds a header.
161
165
162
166
{% tabs %}
163
167
{% tab title="fluent-bit.yaml" %}
164
168
165
169
```yaml
166
170
pipeline:
167
-
171
+
168
172
outputs:
169
173
- name: http
170
174
match: '*'
@@ -193,16 +197,16 @@ pipeline:
193
197
{% endtab %}
194
198
{% endtabs %}
195
199
196
-
#### Example : Sumo Logic HTTP Collector
200
+
#### Sumo Logic HTTP collector
197
201
198
-
Suggested configuration for Sumo Logic using `json_lines` with `iso8601` timestamps. The `PrivateKey` is specific to a configured HTTP collector.
202
+
The following is a suggested configuration for Sumo Logic using `json_lines` with `iso8601` timestamps. The `PrivateKey` is specific to a configured HTTP collector.
0 commit comments