http
Last updated
Was this helpful?
Last updated
Was this helpful?
The out_http
Output plugin writes records via HTTP/HTTPS.
This plugin is introduced since fluentd v1.7.0.
It is included in Fluentd's core.
Please see the article for the basic structure and syntax of the configuration file.
@type
The value must be http
.
endpoint
string
required
1.7.0
The endpoint for HTTP request. If you want to use HTTPS, use https
prefix.
The endpoint
parameter supports placeholders, so you can embed time, tag and record fields in the endpoint. Placeholders also require the buffer section in order to work. Here is an example:
http_method
enum
post
post/put
1.7.0
The method for HTTP request.
proxy
string
optional
1.7.0
The proxy for HTTP request.
content_type
string
nil
1.7.0
Content-Type
for HTTP request. out_http
automatically set Content-Type
for built-in formatters when this parameter is not specified.
Here is a table:
json
with json_array false
: application/x-ndjson
json
with json_array true
: application/json
csv
: text/csv
tsv
, ltsv
: text/tab-separated-values
msgpack
: application/x-msgpack
out_file
, single_value
, stdout
, hash
: text/plain
json_array
bool
false
1.10.4
Using the array format of JSON. This parameter is used and valid only for json format. When json_array
as true, Content-Type should be application/json
and be able to use JSON data for the HTTP request body.
json_array true
json_array false
compress
enum
text
text/gzip
1.17.1
The option to compress HTTP request body.
<format>
DirectiveThe format of the payload. The default @type
is json
.
Here is single_value
example:
headers
hash
nil
1.7.0
Additional headers for HTTP request.
hash
nil
1.12.1
Additional placeholder based headers for HTTP request. If you want to use tag or record field, use this parameter instead of headers
.
open_timeout
integer
nil
1.7.0
The connection open timeout in seconds.
read_timeout
integer
nil
1.7.0
The read timeout in seconds.
ssl_timeout
integer
nil
1.7.0
The TLS timeout in seconds.
reuse_connections
bool
false
1.17.0
Try to reuse connections. This will improve performance.
tls_ca_cert_path
string
nil
1.7.0
The CA certificate path for TLS.
tls_client_cert_path
string
nil
1.7.0
The client certificate path for TLS.
tls_private_key_path
string
nil
1.7.0
The client private key path for TLS.
tls_private_key_passphrase
string
nil
1.7.0
The client private key passphrase for TLS.
tls_verify_mode
enum
peer
peer/none
1.7.0
The verify mode of TLS.
tls_version
enum
TLSv1_2
TLSv1_2/TLSv1_1
1.7.0
The default version of TLS.
tls_ciphers
string
ALL:!aNULL:!eNULL:!SSLv2
1.7.0
The cipher suites configuration of TLS.
error_response_as_unrecoverable
bool
true
1.7.0
Raise UnrecoverableError
when the response code is not SUCCESS, 1xx/3xx/4xx/5xx. If false
, out_http
logs error message instead of raising UnrecoverableError
.
retryable_response_codes
array of int
[503]
1.7.0
The list of retryable response codes. If the response code is included in this list, out_http
retries the buffer flush.
<auth>
SectionSpecifies HTTP authentication.
method
enum
basic
basic/aws_sigv4
basic:1.7.0 / aws_sigv4:1.17.0
The method for HTTP authentication.
basic
: basic authentication
method basic
username
string
nil
1.7.0
The username for basic authentication.
password
string
nil
1.7.0
The password for basic authentication.
method aws_sigv4
aws_service
string
nil
1.17.0
The AWS service to authenticate against.
This parameter is required when you specify aws_sigv4
for method
.
aws_region
string
nil
1.17.0
The AWS region to use when authenticating.
This parameter is required when you specify aws_sigv4
for method
.
aws_role_arn
string
nil
1.17.0
The AWS role ARN to assume when authenticating.
For common output / buffer parameters, please check the following articles:
out_http
's request body depends on <format>
configuration. For example, the default setting generates newline delimited JSON like this:
With @type single_value
:
out_http
and in_http
When getting the following error:
Users should specify json
format with json_array
as true for out_http
configuration:
And receiver in_http
configuration should be:
Or specify msgpack
format:
And, receiver in_http
configuration should be:
For <buffer>
, refer to .
See for more details.
See article for more detail.
See also .
See also .
See also .
aws_sigv4
:
Parameters for .
This parameter is optional when you specify aws_sigv4
for method
. If you provide it, Fluentd will assume that AWS role and send requests signing from that role. Otherwise, Fluentd will use the credentials found by the as defined in the AWS documentation.
But, we recommend to use in/out plugin to communicate with two Fluentd instances due to at-most-once
and at-least-once
semantics for rigidity.
If this article is incorrect or outdated, or omits critical information, please . is an open article- source project under . All components are available under the Apache 2 License.