Send logs and metrics to Better Stack using Vector

Want to collect telemetry data from your Kubernetes or Docker clusters?

The Better Stack collector is the recommended way to automatically gather logs, metrics, and traces without code changes, using eBPF-based auto-instrumentation.

Start logging in 2 minutes

Collect logs and metrics from your server using Vector.

Select your platform:

Install and configure Vector on Ubuntu or Debian:

Set up Vector
curl -sSL https://telemetry.betterstack.com/setup-vector/ubuntu/$SOURCE_TOKEN \
  -o /tmp/setup-vector.sh && \
  bash /tmp/setup-vector.sh


Curious about what the script does?

  • Installs Vector using official package.
  • Configures Vector for your Better Stack source.
  • Enables and restarts Vector.

The script will ask for confirmation before making any changes.

You should see your logs in Better Stack → Logs & traces.

Set up Vector manually

Prefer configuring Vector manually?
Follow step-by-step instructions below.

1. Install

Select your platform:

Configure the Vector APT repository and install Vector:

Install Vector
bash -c "$(curl -L https://setup.vector.dev)"
apt-get install vector

2. Setup

Download Vector configuration for your source, for example Ubuntu:

Download Vector config
CONFIG_YAML_PATH="/etc/vector/vector.yaml"
BACKUP_SUFFIX=".bak-$(date +%Y%m%d%H%M%S)"
mv "${CONFIG_YAML_PATH}" "${CONFIG_YAML_PATH}${BACKUP_SUFFIX}"
DOCKER_PRESENT=$(command -v docker >/dev/null 2>&1 && docker info >/dev/null 2>&1 && echo "true" || echo "false")
curl -o "$CONFIG_YAML_PATH" \
  "https://telemetry.betterstack.test/vector-yaml/ubuntu/$SOURCE_TOKEN?docker=$DOCKER_PRESENT"


Want another config than for Ubuntu?

Our Ubuntu config collects logs for common databases and services.
Pick a different config from available configs or set it up manually.

3. Restart

Restart Vector to reload the configuration:

Restart Vector
systemctl restart vector

You should see your logs in Better Stack → Logs & traces.

Need help?

Please let us know at hello@betterstack.com.
We're happy to help! 🙏

Additional information

Vector sink setup

Want to manually configure Better Stack Vector sink?
Open your Vector config in /etc/vector/vector.yaml and add Better Stack sink. It will automatically use all your Vector sources as inputs.

vector.yaml vector.toml
transforms:
  better_stack_transform:
    type: "remap"
    inputs:
      - "*"
    source: |
      .dt = del(.timestamp)

sinks:
  better_stack:
    type: "http"
    method: "post"
    inputs:
      - "better_stack_transform"
    uri: "https://$INGESTING_HOST/"
    encoding:
      codec: "json"
    compression: "gzip"
    auth:
      strategy: "bearer"
      token: "$SOURCE_TOKEN"
[transforms.better_stack_transform]
type = "remap"
inputs = [ "*" ]
source = '''
.dt = del(.timestamp)
'''

[sinks.better_stack]
type = "http"
method = "post"
inputs = [ "better_stack_transform" ]
uri = "https://$INGESTING_HOST/"
encoding.codec = "json"
compression = "gzip"
auth.strategy = "bearer"
auth.token = "$SOURCE_TOKEN"


Restart Vector to reload the configuration:

Restart Vector
systemctl restart vector

Available configs

We provide ready-to-use Vector configs for databases, web servers, and other services. Download any config we provide from URLs listed below:

DBs Queues Webservers Proxies System
https://telemetry.betterstack.com/vector-yaml/elasticsearch/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/elasticsearch_with_metrics/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/mongodb/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/mysql/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/mysql_with_metrics/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/postgresql/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/postgresql_with_metrics/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/redis/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/redis_with_metrics/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/rabbitmq/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/rabbitmq_with_metrics/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/redis/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/redis_with_metrics/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/apache/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/nginx/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/haproxy/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/traefik/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/traefik_with_metrics/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/auth_log/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/docker/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/kubernetes/$SOURCE_TOKEN
https://telemetry.betterstack.com/vector-yaml/ubuntu/$SOURCE_TOKEN?docker=true
https://telemetry.betterstack.com/vector-yaml/ubuntu/$SOURCE_TOKEN?docker=false
https://telemetry.betterstack.com/vector-yaml/ufw/$SOURCE_TOKEN