http_client output
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: ""
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
follow_redirects: true
backoff_on: [429]
drop_on: []
successful_on: []
proxy_url: "" # No default (optional)
disable_http2: false
batch_as_multipart: false
propagate_response: false
max_in_flight: 64
batching:
count: 0
byte_size: 0
period: ""
check: ""
processors: [] # No default (optional)
multipart: []
When the number of retries expires the output will reject the message, the behavior 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 in Bloblang queries.
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 behavior can be disabled by setting the field batch_as_multipart to false.
Propagate 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"
headers
A map of headers to add to the request.
This field supports interpolation functions.
Type: map of string
Default: {}
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 of string
Default: []
metadata.include_patterns
Provide a list of explicit metadata key regular expression (re2) patterns to match against.
Type: array of string
Default: []
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: ""
Options: TRACE, DEBUG, INFO, WARN, ERROR, FATAL, ``
oauth
Allows you to specify open authentication via OAuth version 1.
Type: object
oauth.enabled
Whether to use OAuth version 1 in requests.
Type: bool
Default: false
oauth.consumer_key
A value used to identify the client to the service provider.
Type: string
Default: ""
oauth.consumer_secret
A secret used to establish ownership of the consumer key.
This field contains sensitive information. Use a secret reference rather than a literal value.
Type: string
Default: ""
oauth.access_token
A value used to gain access to the protected resources on behalf of the user.
This field contains sensitive information. Use a secret reference rather than a literal value.
Type: string
Default: ""
oauth.access_token_secret
A secret provided in order to establish ownership of a given access token.
This field contains sensitive information. Use a secret reference rather than a literal value.
Type: string
Default: ""
oauth2
Allows you to specify open authentication via OAuth version 2 using the client credentials token flow.
Type: object
oauth2.enabled
Whether to use OAuth version 2 in requests.
Type: bool
Default: false
oauth2.client_key
A value used to identify the client to the token provider.
Type: string
Default: ""
oauth2.client_secret
A secret used to establish ownership of the client key.
This field contains sensitive information. Use a secret reference rather than a literal value.
Type: string
Default: ""
oauth2.token_url
The URL of the token provider.
Type: string
Default: ""
oauth2.scopes
A list of optional requested permissions.
Type: array of string
Default: []
oauth2.endpoint_params
A list of optional endpoint parameters, values should be arrays of strings.
Type: map of unknown
Default: {}
basic_auth
Allows you to specify basic authentication.
Type: object
basic_auth.enabled
Whether to use basic authentication in requests.
Type: bool
Default: false
basic_auth.username
A username to authenticate as.
Type: string
Default: ""
basic_auth.password
A password to authenticate with.
This field contains sensitive information. Use a secret reference rather than a literal value.
Type: string
Default: ""
jwt
BETA: Allows you to specify JWT authentication.
Type: object
jwt.enabled
Whether to use JWT authentication in requests.
Type: bool
Default: false
jwt.private_key_file
A file with the PEM encoded via PKCS1 or PKCS8 as private key.
Type: string
Default: ""
jwt.signing_method
A method used to sign the token such as RS256, RS384, RS512 or EdDSA.
Type: string
Default: ""
jwt.claims
A value used to identify the claims that issued the JWT.
Type: map of unknown
Default: {}
jwt.headers
Add optional key/value headers to the JWT.
Type: map of unknown
Default: {}
tls
Custom TLS settings can be used to override system defaults.
Type: object
tls.enabled
Whether custom TLS settings are enabled.
Type: bool
Default: false
tls.skip_cert_verify
Whether to skip server side certificate verification.
Type: bool
Default: false
tls.enable_renegotiation
Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you're seeing the error message local error: tls: no renegotiation.
Type: bool
Default: false
tls.root_cas
An optional root certificate authority to use. This is a string, representing a certificate chain from the parent trusted root certificate, to possible intermediate signing certificates, to the host certificate.
This field contains sensitive information. Use a secret reference rather than a literal value.
Type: string
Default: ""
tls.root_cas_file
An optional path of a root certificate authority file to use. This is a file, often with a .pem extension, containing a certificate chain from the parent trusted root certificate, to possible intermediate signing certificates, to the host certificate.
Type: string
Default: ""
tls.client_certs
A list of client certificates to use. For each certificate either the fields cert and key, or cert_file and key_file should be specified, but not both.
Type: array of object
Default: []
tls.client_certs[].cert
A plain text certificate to use.
Type: string
Default: ""
tls.client_certs[].key
A plain text certificate key to use.
This field contains sensitive information. Use a secret reference rather than a literal value.
Type: string
Default: ""
tls.client_certs[].cert_file
The path of a certificate to use.
Type: string
Default: ""
tls.client_certs[].key_file
The path of a certificate key to use.
Type: string
Default: ""
tls.client_certs[].password
A plain text password for when the private key is password encrypted in PKCS#1 or PKCS#8 format. The obsolete pbeWithMD5AndDES-CBC algorithm is not supported for the PKCS#8 format.
Because the obsolete pbeWithMD5AndDES-CBC algorithm does not authenticate the ciphertext, it is vulnerable to padding oracle attacks that can let an attacker recover the plaintext.
This field contains sensitive information. Use a secret reference rather than a literal value.
Type: string
Default: ""
extract_headers
Specify which response headers should be added to resulting synchronous response messages as metadata. Header keys are lowercased before matching, so ensure that your patterns target lowercased versions of the header keys that you expect. This field is not applicable unless propagate_response is set to true.
Type: object
extract_headers.include_prefixes
Provide a list of explicit metadata key prefixes to match against.
Type: array of string
Default: []
extract_headers.include_patterns
Provide a list of explicit metadata key regular expression (re2) patterns to match against.
Type: array of string
Default: []
rate_limit
An optional rate limit to throttle requests by.
Type: string
timeout
A static timeout to apply to requests.
Type: string
Default: "5s"
retry_period
The base period to wait between failed requests.
Type: string
Default: "1s"
max_retry_backoff
The maximum period to wait between failed requests.
Type: string
Default: "300s"
retries
The maximum number of retry attempts to make.
Type: int
Default: 3
follow_redirects
Whether or not to transparently follow redirects, i.e. responses with 300-399 status codes. If disabled, the response message will contain the body, status, and headers from the redirect response and the processor will not make a request to the URL set in the Location header of the response.
Type: bool
Default: true
backoff_on
A list of status codes whereby the request should be considered to have failed and retries should be attempted, but the period between them should be increased gradually.
Type: array of int
Default: [429]
drop_on
A list of status codes whereby the request should be considered to have failed but retries should not be attempted. This is useful for preventing wasted retries for requests that will never succeed. Note that with these status codes the request is dropped, but message that caused the request will not be dropped.
Type: array of int
Default: []
successful_on
A list of status codes whereby the attempt should be considered successful, this is useful for dropping requests that return non-2XX codes indicating that the message has been dealt with, such as a 303 See Other or a 409 Conflict. All 2XX codes are considered successful unless they are present within backoff_on or drop_on, regardless of this field.
Type: array of int
Default: []
proxy_url
An optional HTTP proxy URL.
Type: string
disable_http2
Whether or not to disable disable HTTP/2
Type: bool
Default: false
batch_as_multipart
Send message batches as a single request using RFC1341. If disabled messages in batches will be sent as individual requests.
Type: bool
Default: false
propagate_response
Whether responses from the server should be propagated back to the input.
Type: bool
Default: false
max_in_flight
The maximum number of parallel message batches to have in flight at any given time.
Type: int
Default: 64
batching
Allows you to configure a batching policy.
Type: object
batching.count
A number of messages at which the batch should be flushed. If 0 disables count based batching.
Type: int
Default: 0
batching.byte_size
An amount of bytes at which the batch should be flushed. If 0 disables size based batching.
Type: int
Default: 0
batching.period
A period in which an incomplete batch should be flushed regardless of its size.
Type: string
Default: ""
batching.check
A Bloblang query that should return a boolean value indicating whether a message should end a batch.
Type: string
Default: ""
batching.processors
A list of processors to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. Please note that all resulting messages are flushed as a single batch, therefore splitting the batch into smaller batches using these processors is a no-op.
Type: array of processor
multipart
EXPERIMENTAL: Create explicit multipart HTTP requests by specifying an array of parts to add to the request, each part specified consists of content headers and a data field that can be populated dynamically. If this field is populated it will override the default request creation behavior.
Type: array of object
Default: []
multipart[].content_type
The content type of the individual message part.
This field supports interpolation functions.
Type: string
Default: ""
multipart[].content_disposition
The content disposition of the individual message part.
This field supports interpolation functions.
Type: string
Default: ""
multipart[].body
The body of the individual message part.
This field supports interpolation functions.
Type: string
Default: ""
When to Use
Use http_client output when you need to:
- Send data to REST APIs — Elasticsearch, webhooks, custom services
- Forward processed events to downstream HTTP endpoints
- Integrate with SaaS platforms — Slack, PagerDuty, Datadog
Don't use this if:
- The destination has a native output — use
aws_s3, etc. - You need bi-directional communication — use
websocket - You're sending to Kafka — use
kafka
Common Patterns
POST JSON to API
output:
http_client:
url: "https://api.example.com/events"
verb: POST
headers:
Content-Type: application/json
Authorization: "Bearer ${API_TOKEN}"
Batch Requests
Reduce API calls by sending one request per batch. Batching alone doesn't do this: each message of a batch is still sent as its own request. The archive processor joins the batch into a single JSON array, which becomes the request body:
output:
http_client:
url: "https://api.example.com/bulk"
verb: POST
headers:
Content-Type: application/json
batching:
count: 100
period: 10s
processors:
- archive:
format: json_array
With Retry
Handle transient failures. Failed requests are retried up to retries times, waiting retry_period between attempts; for status codes listed in backoff_on the wait grows gradually up to max_retry_backoff.
Retries can duplicate side effects: a request that times out after the server accepted it is sent again, and the endpoint sees it twice. Use an idempotent endpoint, or send an idempotency key the server can deduplicate on. That key has to be identical across attempts and distinct for every event, so read it from something the message already carries, or stamp one before the output:
pipeline:
processors:
# Stamped once per message, so every retry of that message reuses it.
- mapping: 'meta idempotency_key = uuid_v4()'
output:
http_client:
url: "https://api.example.com/events"
verb: POST
headers:
Idempotency-Key: '${! @idempotency_key }'
retries: 5
retry_period: 2s
max_retry_backoff: 30s
backoff_on: [429, 503]
When the event already has an identifier, use that instead (${! json("event_id") }, or a broker-supplied key such as ${! @kafka_key }). It deduplicates retries and also collapses re-deliveries of the same event from an at-least-once input, which a freshly minted key cannot.
Hashing the payload (${! content().hash("sha256").encode("hex") }) is only safe where identical bytes always mean the same event. Two distinct events carrying the same payload, such as a sensor reporting the same reading twice, would share a key and the second would be discarded as a duplicate.