Vector
Ship logs from Vector over HTTPS JSON, Splunk HEC or TCP SSL
Use Vector to collect logs from files, containers, syslog and other sources and send them to your Logit.io Logs stack. Vector can send over three routes today: the HTTPS JSON API, the Splunk HEC endpoint or a TCP SSL input. Start with HTTPS JSON unless you already use HEC or a TCP SSL input.
Logs
Install integration
Choose a route
| Route | Vector sink | Use it when |
|---|---|---|
| HTTPS JSON | http | You want the simplest setup. One API key authenticates the request. |
| Splunk HEC | splunk_hec_logs | You already send to Splunk. Change the endpoint and token, then turn compression and indexer acknowledgement off. |
| TCP SSL | socket | You prefer a persistent TLS connection to a Logstash TCP SSL input. |
All three snippets are illustrative. They assume a source or transform named app_logs already exists. Replace inputs with your own component ID. To read log files, add a file source (opens in a new tab):
[sources.app_logs]
type = "file"
include = ["/var/log/*.log"]Configure the sink
Send newline-delimited JSON to the /v2 endpoint. The key and endpoint populate in the example when you sign in and select a stack. Vector HTTP sink reference (opens in a new tab)
[sinks.logit_http]
type = "http"
inputs = ["app_logs"]
uri = "https://@logitApiEndpoint/v2"
method = "post"
compression = "none"
encoding.codec = "json"
framing.method = "newline_delimited"
batch.max_events = 1000
batch.max_bytes = 1000000
request.headers.ApiKey = "@apikey"The settings that matter:
compression = "none"because the API rejects gzip-compressed bodies.framing.method = "newline_delimited"sends NDJSON withContent-Type: application/x-ndjson, which the API accepts.batch.max_events = 1000matches the API's limit of 1,000 events per request.batch.max_bytes = 1000000keeps each request about 1 MB. Vector's default batch size for thehttpsink is larger than the API's 9,800,000-byte limit, so set it explicitly.ApiKeyis the recommended credential header. See JSON via HTTP/S for the other methods and for limits, response codes and retries.
Events from a file source carry file, host, message, source_type and timestamp fields. Use a remap transform (opens in a new tab) to add, rename or remove fields before the sink.
Validate and start Vector
Check the file without connecting to anything. --no-environment skips the health checks, so the command makes no network connections.
vector validate --no-environment vector.tomlStart Vector.
vector --config vector.tomlVector batches events, so a log can take a few seconds to leave the host. For HTTPS JSON, HTTP 202 means the API has queued the events. They can take a short time to appear in OpenSearch.
Launch OpenSearch Dashboards to view your data
Launch OpenSearch DashboardsHow to diagnose no data in your stack
If you don't see data appearing in your stack after following this integration, take a look at the troubleshooting guide for steps to diagnose and resolve the problem or contact our support team and we'll be happy to assist.
Related guides
- JSON via HTTP/S for limits, responses and retries.
- Splunk HEC for the HEC endpoint and event normalisation.
- Migrate from Datadog to use Vector as a proxy for the Datadog Agent.
- Grafana Alloy and OpenTelemetry Collector for OTLP-based collection.