http_client
Sends messages to an HTTP server.
- Common
- Advanced
# Common config fields, showing default values
output:
label: ""
http_client:
url: "" # No default (required)
verb: POST
headers: {}
rate_limit: "" # No default (optional)
timeout: 5s
max_in_flight: 64
batching:
count: 0
byte_size: 0
period: ""
jitter: 0
check: ""
# All config fields, showing default values
output:
label: ""
http_client:
url: "" # No default (required)
verb: POST
headers: {}
metadata:
include_prefixes: []
include_patterns: []
dump_request_log_level: ""
oauth:
enabled: false
consumer_key: ""
consumer_secret: ""
access_token: ""
access_token_secret: ""
oauth2:
enabled: false
client_key: ""
client_secret: ""
token_url: ""
scopes: []
endpoint_params: {}
basic_auth:
enabled: false
username: ""
password: ""
jwt:
enabled: false
private_key_file: ""
signing_method: ""
claims: {}
headers: {}
tls:
enabled: false
skip_cert_verify: false
enable_renegotiation: false
root_cas: ""
root_cas_file: ""
client_certs: []
extract_headers:
include_prefixes: []
include_patterns: []
rate_limit: "" # No default (optional)
timeout: 5s
retry_period: 1s
max_retry_backoff: 300s
retries: 3
backoff_on:
- 429
drop_on: []
successful_on: []
proxy_url: "" # No default (optional)
transport:
dial_context:
timeout: 30s
keep_alive: 30s
force_http2: true
max_idle_connections: 100
idle_connection_timeout: 90s
tls_handshake_timeout: 10s
expect_continue_timeout: 1s
batch_as_multipart: false
propagate_response: false
max_in_flight: 64
batching:
count: 0
byte_size: 0
period: ""
jitter: 0
check: ""
processors: [] # No default (optional)
multipart: []
When the number of retries expires the output will reject the message, the behaviour after this will depend on the pipeline but usually this simply means the send is attempted again until successful whilst applying back pressure.
The URL and header values of this type can be dynamically set using function interpolations described here.
The body of the HTTP request is the raw contents of the message payload. If the message has multiple parts (is a batch) the request will be sent according to RFC1341. This behaviour can be disabled by setting the field batch_as_multipart to false.
Propagating Responses
It's possible to propagate the response from each HTTP request back to the input source by setting propagate_response to true. Only inputs that support synchronous responses are able to make use of these propagated responses.
Performance
This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field max_in_flight.
This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more in this doc.
Fields
url
The URL to connect to. This field supports interpolation functions.
Type: string
verb
A verb to connect with
Type: string
Default: "POST"
# Examples
verb: POST
verb: GET
verb: DELETE
headers
A map of headers to add to the request. This field supports interpolation functions.
Type: object
Default: {}
# Examples
headers:
Content-Type: application/octet-stream
traceparent: ${! tracing_span().traceparent }
metadata
Specify optional matching rules to determine which metadata keys should be added to the HTTP request as headers.
Type: object
metadata.include_prefixes
Provide a list of explicit metadata key prefixes to match against.
Type: array
Default: []
# Examples
include_prefixes:
- foo_
- bar_
include_prefixes:
- kafka_
include_prefixes:
- content-
metadata.include_patterns
Provide a list of explicit metadata key regular expression (re2) patterns to match against.
Type: array
Default: []
# Examples
include_patterns:
- .*
include_patterns:
- _timestamp_unix$
dump_request_log_level
EXPERIMENTAL: Optionally set a level at which the request and response payload of each request made will be logged.
Type: string
Default: ""
Requires version 1.0.0 or newer
Options: TRACE, DEBUG, INFO, WARN, ERROR, FATAL, ``.
oauth
Allows you to specify open authentication via OAuth version 1.
Type: object