HTTP Source
The Vector http source
ingests data through the HTTP protocol and outputs
log events.
Requirements
Configuration
- Common
- Advanced
[sources.my_source_id]type = "http" # requiredaddress = "0.0.0.0:80" # requiredencoding = "text" # optional, defaultheaders = ["User-Agent", "X-My-Custom-Header"] # optional, no default
- stringrequired
address
The address to listen for connections on
- No default
- View examples
- stringoptional
encoding
The expected encoding of received data. Note that for
jsonandndjsonencodings, the fields of the JSON objects are output as separate fields.- Default:
"text" - Enum, must be one of:
"text""ndjson""json" - View examples
- Default:
- [string]optional
headers
A list of HTTP headers to include in the log event. These will override any values included in the JSON payload with conflicting names. An empty string will be inserted into the log event if the corresponding HTTP header was missing.
- No default
- View examples
- tableoptional
tls
Configures the TLS options for connections from this source.
- stringoptional
ca_file
Absolute path to an additional CA certificate file, in DER or PEM format (X.509), or an inline CA certificate in PEM format.
- No default
- View examples
- stringoptional
crt_file
Absolute path to a certificate file used to identify this server, in DER or PEM format (X.509) or PKCS#12, or an inline certificate in PEM format. If this is set and is not a PKCS#12 archive,
key_filemust also be set. This is required ifenabledis set totrue.- No default
- View examples
- booloptional
enabled
Require TLS for incoming connections. If this is set, an identity certificate is also required.
- Default:
false - View examples
- Default:
- stringoptional
key_file
Absolute path to a private key file used to identify this server, in DER or PEM format (PKCS#8), or an inline private key in PEM format.
- No default
- View examples
- stringoptional
key_pass
Pass phrase used to unlock the encrypted key file. This has no effect unless
key_fileis set.- No default
- View examples
- booloptional
verify_certificate
If
true, Vector will require a TLS certificate from the connecting host and terminate the connection if it is not valid. Iffalse(the default), Vector will not request a certificate from the client.- WARNING: Setting this to `false` will cause OpenSSL to not request a certificate from the client
- Default:
false - View examples
Fields
{// ..."message": "This is one line from the plain text HTTP body","timestamp": "2019-11-01T21:15:47+00:00"// ...}
- stringrequired*
message
The message field, containing the plain text message.
- Only required when:
encoding=["text"] - No default
- View examples
- Only required when:
- timestamprequired
timestamp
The time the event was ingested. Note this may be overridden by JSON payloads.
- No default
- View examples
How It Works
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.
TLS
Vector uses Openssl for TLS protocols for it's battle-tested
and reliable security. You can enable and adjust TLS behavior via the tls.*
options.

