http_client

Sends messages to a HTTP server.

  • Common

  • Advanced

# Common configuration 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: "" # Optional
      check: "" # Optional
# All configuration fields, showing default values
output:
  label: ""
  http_client:
    url: "" # No default (required)
    verb: POST
    headers: {}
    metadata:
      include_prefixes: []
      include_patterns: []
    dump_request_log_level: "" # Optional
    oauth:
      enabled: false
      consumer_key: "" # Optional
      consumer_secret: "" # Optional
      access_token: "" # Optional
      access_token_secret: "" # Optional
    oauth2:
      enabled: false
      client_key: "" # Optional
      client_secret: "" # Optional
      token_url: "" # Optional
      scopes: []
      endpoint_params: {}
    basic_auth:
      enabled: false
      username: "" # Optional
      password: "" # Optional
    jwt:
      enabled: false
      private_key_file: "" # Optional
      signing_method: "" # Optional
      claims: {}
      headers: {}
    tls:
      enabled: false
      skip_cert_verify: false
      enable_renegotiation: false
      root_cas: ""
      root_cas_file: ""
      client_certs: []
    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)
    batch_as_multipart: false
    max_in_flight: 64
    batching:
      count: 0
      byte_size: 0
      period: "" # Optional
      check: "" # Optional
      processors: [] # No default (optional)
    multipart: []

Message sends

The body of the request sent to the HTTP server is the raw contents of the message payload. If the message has multiple parts (is a batch), the request is sent according to RFC1341. To disable this behavior, set the batch_as_multipart field to false.

When message retries are exhausted, this output rejects a message. Typically, a pipeline then continues attempts to send the message until it succeeds, whilst applying back pressure.

Dynamic URL and header settings

You can set the url and headers values dynamically using function interpolations.

Performance

For improved performance, this output sends:

  • Multiple messages in parallel. Adjust the max_in_flight field value to tune the maximum number of in-flight messages (or message batches).

  • Messages as batches. You can configure batches at both input and output level. For more information, see Message Batching.

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 matching rules that determine which metadata keys to add to the HTTP request as headers (optional).

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: Set the logging level for the request and response payloads of each HTTP request.

Type: string

Default: ""

Options: TRACE , DEBUG , INFO , WARN , ERROR , FATAL

oauth

Allows you to specify open authentication using 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

The secret used to establish ownership of the consumer key.

This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see Manage Secrets before adding it to your configuration.

Type: string

Default: ""

oauth.access_token

The value used to gain access to the protected resources on behalf of the user.

Type: string

Default: ""

oauth.access_token_secret

The secret that establishes ownership of the oauth.access_token.

This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see Manage Secrets before adding it to your configuration.

Type: string

Default: ""

oauth2

Allows you to specify open authentication using OAuth version 2 and 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

The secret used to establish ownership of the client key.

This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see Manage Secrets before adding it to your configuration.

Type: string

Default: ""

oauth2.token_url

The URL of the token provider.

Type: string

Default: ""

oauth2.scopes

A list of requested permissions (optional).

Type: array

Default: []

oauth2.endpoint_params

A list of endpoint parameters specified as arrays of strings (optional).

Type: object

Default: {}

# Examples

endpoint_params:
  grant_type:
    - client_credentials
  audience:
    - https://api.example.com/
    - https://auth.example.com/

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 that usually shouldn’t be added to a configuration directly. For more information, see Manage Secrets before adding it to your configuration.

Type: string

Default: ""

jwt

BETA: Allows you to specify JSON Web Token (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 using 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: object

Default: {}

jwt.headers

Add key/value headers to the JWT (optional).

Type: object

Default: {}

tls

Override system defaults with custom TLS settings.

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

Specify a root certificate authority to use (optional). This is a string, representing a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate.

This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see Manage Secrets before adding it to your configuration.

Type: string

Default: ""

# Examples

root_cas: |-
  -----BEGIN CERTIFICATE-----
  ...
  -----END CERTIFICATE-----

tls.root_cas_file

Specify the path to a root certificate authority file (optional). This is a file, often with a .pem extension, which contains a certificate chain from the parent-trusted root certificate, through possible intermediate signing certificates, to the host certificate.

Type: string

Default: ""

# Examples

root_cas_file: ./root_cas.pem

tls.client_certs

A list of client certificates to use. For each certificate, specify values for either the cert and key fields, or cert_file and key_file fields.

Type: array

Default: []

# Examples

client_certs:
  - cert: foo
    key: bar

client_certs:
  - cert_file: ./example.pem
    key_file: ./example.key

tls.client_certs[].cert

The plain text certificate to use.

Type: string

Default: ""

tls.client_certs[].key

The plain text certificate key to use.

This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see Manage Secrets before adding it to your configuration.

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.

The pbeWithMD5AndDES-CBC algorithm does not authenticate ciphertext, and is vulnerable to padding oracle attacks that may allow an attacker to recover the plain text password.

This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see Manage Secrets before adding it to your configuration.

Type: string

Default: ""

# Examples

password: foo

password: ${KEY_PASSWORD}

rate_limit

A rate limit to throttle requests by (optional).

Type: string

timeout

A static timeout to apply to requests.

Type: string

Default: 5s

retry_period

The initial period to wait between failed requests before retrying.

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

backoff_on

A list of status codes that indicate a request failure and trigger retries with an increasing backoff period between attempts.

Type: array

Default: [429]

drop_on

A list of status codes that indicate a request failure where the input should not attempt retries. This helps avoid unnecessary retries for requests that are unlikely to succeed.

In these cases, the request is dropped, but the message that triggered the request is retained.

Type: array

Default: []

successful_on

A list of HTTP status codes that should be considered as successful, even if they are not 2XX codes. This is useful for handling cases where non-2XX codes indicate that the request was processed successfully, such as 303 See Other or 409 Conflict.

By default, all 2XX codes are considered successful unless they are specified in backoff_on or drop_on fields.

Type: array

Default: []

proxy_url

A HTTP proxy URL (optional).

Type: string

batch_as_multipart

When set to true, sends all message in a batch as a single request using RFC1341.

When set to false, sends messages in a batch as individual requests.

Type: bool

Default: false

max_in_flight

The maximum number of messages to have in flight at a given time. Increase this to improve throughput.

Type: int

Default: 64

batching

Allows you to configure a batching policy.

Type: object

# Examples

batching:
  byte_size: 5000
  count: 0
  period: 1s

batching:
  count: 10
  period: 1s

batching:
  check: this.contains("END BATCH")
  count: 0
  period: 1m

batching.count

The number of messages after which the batch is flushed. Set to 0 to disable count-based batching.

Type: int

Default: 0

batching.byte_size

The amount of bytes at which the batch is flushed. Set to 0 to disable size-based batching.

Type: int

Default: 0

batching.period

The period after which an incomplete batch is flushed regardless of its size.

Type: string

Default: ""

# Examples

period: 1s

period: 1m

period: 500ms

batching.check

A Bloblang query that should return a boolean value indicating whether a message should end a batch.

Type: string

Default: ""

# Examples

check: this.type == "end_of_transaction"

batching.processors

For aggregating and archiving message batches, you can add a list of processors to apply to a batch as it is flushed. All resulting messages are flushed as a single batch even when you configure processors to split the batch into smaller batches.

Type: array

# Examples

processors:
  - archive:
      format: concatenate

processors:
  - archive:
      format: lines

processors:
  - archive:
      format: json_array

multipart

EXPERIMENTAL: Create explicit multipart HTTP requests by specifying an array of parts to add to a request. Each part consists of content headers and a data field, which can be populated dynamically.

If populated, this field overrides the default request creation behavior.

Type: array

Default: []

multipart[].content_type

The content type of the individual message part. This field supports interpolation functions.

Type: string

Default: ""

# Examples

content_type: application/bin

multipart[].content_disposition

The content disposition of the individual message part. This field supports interpolation functions. For more information, see

Type: string

Default: ""

# Examples

content_disposition: form-data; name="bin"; filename='${! @AttachmentName }

multipart[].body

The body of the individual message part. This field supports interpolation functions.

Type: string

Default: ""

# Examples

body: ${! this.data.part1 }