http_server source (also available as http) creates an HTTP server that accepts log data via POST requests. It supports authentication, TLS, compression, and multiple encoding formats.
Configuration
Parameters
Socket address to listen on. Must include a port.
URL path on which to accept requests.
Whether to treat the path as absolute or prefix-based.When
false, requests to any path starting with path are accepted.HTTP method to accept.Options:
GET, POSTHTTP status code to return on successful requests.
List of HTTP headers to include in log events. Supports wildcards.
List of URL query parameters to include in log events. Supports wildcards.
Field name for the request URL path.
Field name for the remote IP address.
Framing configuration for splitting byte streams.
Decoding configuration for parsing messages.
HTTP authentication configuration.
TLS configuration for HTTPS.
Enable end-to-end acknowledgements.
Output Schema
The HTTP source produces log events with the following fields:| Field | Type | Description |
|---|---|---|
message | string | The decoded request body |
path | string | Request URL path |
host | string | Client IP address (if host_key is set) |
timestamp | timestamp | When the request was received |
source_type | string | Always “http_server” |
| Custom headers | varies | Headers matching the headers configuration |
| Query parameters | varies | Parameters matching the query_parameters configuration |
Examples
Basic HTTP Server
HTTPS with Authentication
JSON Decoding with Headers
Query Parameter Extraction
Multiple Paths with Wildcards
Newline-Delimited Text
Custom Response Code
How It Works
Request Processing
- Client sends HTTP POST request to the configured path
- Vector authenticates the request (if auth is configured)
- Request body is decompressed (if Content-Encoding header is present)
- Body is decoded according to the framing and decoding configuration
- Metadata (headers, query params, path) is added to each event
- Events are sent through the pipeline
- HTTP response is returned (200 or configured
response_code)
Compression
The source automatically decompresses requests with:Content-Encoding: gzipContent-Encoding: deflateContent-Encoding: gzip, deflate(multiple encodings)
Authentication
Basic HTTP authentication is supported:Acknowledgements
When acknowledgements are enabled:- Vector waits for events to be delivered to sinks before responding
- Failed deliveries result in 400 response
- Successful deliveries result in configured
response_code
Performance
- Can handle thousands of requests per second
- Performance depends on request size and decoding complexity
- Consider using a load balancer for high-traffic scenarios
- Keep-alive connections improve throughput
Best Practices
- Use HTTPS in production with valid certificates
- Enable authentication for public-facing endpoints
- Configure specific paths rather than accepting all paths
- Use
acknowledgements = truefor critical data - Monitor HTTP error rates via Vector’s internal metrics
- Set appropriate
response_codefor async processing (e.g., 202) - Use wildcard header/query extraction sparingly
- Configure rate limiting at the load balancer level
- Test failure scenarios to ensure proper error handling
- Use structured logging (JSON) for better downstream processing