Send logs to Better Stack using Vector

Start logging in 2 minutes

Collect logs and metrics from your server using Vector.

Select your platform:

Ubuntu • Debian

Install and configure Vector  on Ubuntu or Debian:

Set up Vector
curl -sSL https://logs.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 → Live tail .

Set up Vector manually

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

1. Install

Select your platform:

Ubuntu • Debian

Configure the Vector  APT repository and install Vector:

Install Vector
curl -1sLf \
  'https://repositories.timber.io/public/vector/cfg/setup/bash.deb.sh' \
  | sudo -E bash
apt-get install vector

2. Setup

Download Vector configuration for your source:

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}"
mv "${CONFIG_YAML_PATH%.yaml}.toml" "${CONFIG_YAML_PATH%.yaml}.toml${BACKUP_SUFFIX}"
curl -o "$CONFIG_YAML_PATH" \
  https://logs.betterstack.com/vector-yaml/ubuntu/$SOURCE_TOKEN

Want another config than for Ubuntu?

Our Ubuntu config collects logs for common databases and services.
Pick a different config from available configs.

3. Restart

Restart Vector to reload the configuration:

Restart Vector
systemctl restart vector

You should see your logs in Better Stack → Live tail .

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:

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://in.logs.betterstack.com/"
    encoding:
      codec: "json"
    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://in.logs.betterstack.com/"
encoding.codec = "json"
auth.strategy = "bearer"
auth.token = "$SOURCE_TOKEN"

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:

Databases Web servers Other
https://logs.betterstack.com/vector-yaml/postgresql/$SOURCE_TOKEN
https://logs.betterstack.com/vector-yaml/mysql/$SOURCE_TOKEN
https://logs.betterstack.com/vector-yaml/mysql_with_metrics/$SOURCE_TOKEN
https://logs.betterstack.com/vector-yaml/mongodb/$SOURCE_TOKEN
https://logs.betterstack.com/vector-yaml/redis/$SOURCE_TOKEN
https://logs.betterstack.com/vector-yaml/apache/$SOURCE_TOKEN
https://logs.betterstack.com/vector-yaml/nginx/$SOURCE_TOKEN
https://logs.betterstack.com/vector-yaml/haproxy/$SOURCE_TOKEN
https://logs.betterstack.com/vector-yaml/auth_log/$SOURCE_TOKEN
https://logs.betterstack.com/vector-yaml/ufw/$SOURCE_TOKEN
https://logs.betterstack.com/vector-yaml/docker/$SOURCE_TOKEN