http sink

Batches `log` events to a generic HTTP endpoint.

The http sink batches log events to a generic HTTP endpoint.

Config File

vector.toml (simple)
vector.toml (advanced)
# REQUIRED - General
type = "http" # must be: "http"
inputs = ["my-source-id"]
encoding = "ndjson" # enum: "ndjson" or "text"
uri = ""
# OPTIONAL - General
compression = "gzip" # no default, must be: "gzip" (if supplied)
# OPTIONAL - Batching
batch_size = 1049000 # default, bytes
batch_timeout = 5 # default, seconds
# For a complete list of options see the "advanced" tab above.


The http sink batches log up to the batch_size or batch_timeout options. When flushed, Vector will write to a generic HTTP endpoint. The encoding is dictated by the encoding option. For example:

POST <host>/_bulk HTTP/1.1
Host: <host>
Content-Type: application/x-ndjson
Content-Length: 654
{ "index" : { "_index" : "<index>" } }
{"timestamp": 1557932537, "message": "GET /roi/evolve/embrace/transparent", "host": "Stracke8362", "process_id": 914, "remote_addr": "", "response_code": 504, "bytes": 29763}
{ "index" : { "_index" : "<index>" } }
{"timestamp": 1557933548, "message": "PUT /value-added/b2b", "host": "Wiza2458", "process_id": 775, "remote_addr": "", "response_code": 503, "bytes": 9468}
{ "index" : { "_index" : "<index>" } }
{"timestamp": 1557933742, "message": "DELETE /reinvent/interfaces", "host": "Herman3087", "process_id": 775, "remote_addr": "", "response_code": 503, "bytes": 9700}

How It Works


HTTP authentication is controlled via the Authorization header which you can set with the headers option. For convenience, Vector also supports the basic_auth.username and basic_auth.password options which handle setting the Authorization header for the base access authentication scheme.

Buffers & Batches

The http sink buffers & batches data as shown in the diagram above. You'll notice that Vector treats these concepts differently, instead of treating them as global concepts, Vector treats them as sink specific concepts. This isolates sinks, ensuring services disruptions are contained and delivery guarantees are honored.

Buffers types

The buffer.type option allows you to control buffer resource usage:




Pros: Fast. Cons: Not persisted across restarts. Possible data loss in the event of a crash. Uses more memory.


Pros: Persisted across restarts, durable. Uses much less memory. Cons: Slower, see below.

Buffer overflow

The buffer.when_full option allows you to control the behavior when the buffer overflows:




Applies back pressure until the buffer makes room. This will help to prevent data loss but will cause data to pile up on the edge.


Drops new data as it's received. This data is lost. This should be used when performance is the highest priority.

Batch flushing

Batches are flushed when 1 of 2 conditions are met:

  1. The batch age meets or exceeds the configured batch_timeout (default: 5 seconds).

  2. The batch size meets or exceeds the configured batch_size (default: 1049000 bytes).


The http sink compresses payloads before flushing. This helps to reduce the payload size, ultimately reducing bandwidth and cost. This is controlled via the compression option. Each compression type is described in more detail below:




The payload will be compressed in Gzip format before being sent.

Delivery Guarantee

This component offers an at least once delivery guarantee if your pipeline is configured to achieve this.


The http sink encodes events before writing them downstream. This is controlled via the encoding option which accepts the following options:




The payload will be encoded in new line delimited JSON payload, each line representing a JSON encoded event.


The payload will be encoded as new line delimited text, each line representing the value of the "message" key.

Dynamic encoding

By default, the encoding chosen is dynamic based on the explicit/implcit nature of the event's structure. For example, if this event is parsed (explicit structuring), Vector will use json to encode the structured data. If the event was not explicitly structured, the text encoding will be used.

To further explain why Vector adopts this default, take the simple example of accepting data over the tcp source and then connecting it directly to the http sink. It is less surprising that the outgoing data reflects the incoming data exactly since it was not explicitly structured.

Environment Variables

Environment variables are supported through all of Vector's configuration. Simply add ${MY_ENV_VAR} in your Vector configuration file and the variable will be replaced before being evaluated.

You can learn more in the Environment Variables section.

Health Checks

Health checks ensure that the downstream service is accessible and ready to accept data. This check is performed upon sink initialization. In order to run this check you must provide a value for the healthcheck_uri option.

If the health check fails an error will be logged and Vector will proceed to start. If you'd like to exit immediately upon health check failure, you can pass the --require-healthy flag:

vector --config /etc/vector/vector.toml --require-healthy

And finally, if you'd like to disable health checks entirely for this sink you can set the healthcheck option to false.

Rate Limits

Vector offers a few levers to control the rate and volume of requests to the downstream service. Start with the rate_limit_duration and rate_limit_num options to ensure Vector does not exceed the specified number of requests in the specified window. You can further control the pace at which this window is saturated with the request_in_flight_limit option, which will guarantee no more than the specified number of requests are in-flight at any given time.

Please note, Vector's defaults are carefully chosen and it should be rare that you need to adjust these. If you found a good reason to do so please share it with the Vector team by opening an issie.

Retry Policy

Vector will retry failed requests (status == 429, >= 500, and != 501). Other responses will not be retried. You can control the number of retry attempts and backoff rate with the retry_attempts and retry_backoff_secs options.


To ensure the pipeline does not halt when a service fails to respond Vector will abort requests after 30 seconds. This can be adjsuted with the request_timeout_secs option.

It is highly recommended that you do not lower value below the service's internal timeout, as this could create orphaned requests, pile on retries, and result in deuplicate data downstream.


The best place to start with troubleshooting is to check the Vector logs. This is typically located at /var/log/vector.log, then proceed to follow the Troubleshooting Guide.

If the Troubleshooting Guide does not resolve your issue, please:

  1. Check for any open http_sink issues.

  2. If encountered a bug, please file a bug report.

  3. If encountered a missing feature, please file a feature request.

  4. If you need help, join our chat/forum community. You can post a question and search previous questions.