Install Vector From Source

This page covers installing Vector from source using the native toolchain for the host.

Vector can also be compiled to a static binary for Linux for x86_64, ARM64, and ARMv7 architectures. See compiling using Docker for details.

Installation

  • Linux
  • Windows
  • Docker

The following steps should be used to compile Vector directly on Linux based systems.

  1. Install Rust

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
  2. Install C and C++ compilers (GCC or Clang) and GNU make if they are not pre-installed on your system.

  3. Create the vector directory

    mkdir vector
  4. Download Vector's Source

    • Latest (0.8.0)
    • Master
    mkdir -p vector && \
    curl -sSfL --proto '=https' --tlsv1.2 https://api.github.com/repos/timberio/vector/tarball/v0.8.X | \
    tar xzf - -C vector --strip-components=1
  5. Change into the vector directory

    cd vector
  6. Compile Vector

    [FEATURES="<flag1>,<flag2>,..."] make build

    The FEATURES environment variable is optional. You can override the default features with this variable. See feature flags for more info.

    When finished, the vector binary will be placed in target/<target>/release/vector. For example, if you are building Vector on your Mac, your target triple is x86_64-apple-darwin, and the Vector binary will be located at target/x86_64-apple-darwin/release/vector.

  7. Start Vector

    Finally, start vector:

    target/<target>/release/vector --config config/vector.toml

Next Steps

Configuring

The Vector configuration file is located at:

config/vector.toml

A full spec is located at config/vector.spec.toml and examples are located in config/vector/examples/*. You can learn more about configuring Vector in the Configuration section.

Data Directory

We highly recommend creating a data directory that Vector can use:

mkdir /var/lib/vector

Vector offers a global data_dir option that you can use to specify the path of your directory.

vector.toml
data_dir = "/var/lib/vector" # default

Service Managers

Vector archives ship with service files in case you need them:

Init.d

To install Vector into Init.d run:

cp -av distribution/init.d/vector /etc/init.d

Systemd

To install Vector into Systemd run:

cp -av distribution/systemd/vector.service /etc/systemd/system

Updating

Simply follow the same installation instructions above.

How It Works

Feature Flags

The following feature flags are supported via the FEATURES env var when executing make build:

[FEATURES="<flag1>,<flag2>,..."] make build

There are three meta-features which can be used when compiling for the corresponding targets. If no features are specified, then the default one is used.

FeatureDescriptionEnabled by default
defaultDefault set of features for *-unknown-linux-gnu and *-apple-darwin targets.
default-muslDefault set of features for *-unknown-linux-musl targets. Requires cmake and perl as build dependencies.
default-msvcDefault set of features for *-pc-windows-msvc targets. Requires cmake and perl as build dependencies.

Alternatively, for finer control, it is possible to use specific features from the list below:

FeatureDescriptionIncluded in default feature
unixEnables features that require cfg(unix) to be present on the platform, namely support for Unix domain sockets in docker source and jemalloc instead of the default memory allocator.
vendoredForces vendoring of OpenSSL and ZLib dependencies instead of using their versions installed in the system. Requires perl as a build dependency.
leveldb-plainEnables support for disk buffers using vendored LevelDB.
leveldb-cmakeThe same as leveldb-plain, but is more portable. Requires cmake as a build dependency. Use it in case of compilation issues with leveldb-plain.
rdkafka-plainEnables vendored librdkafka dependency, which is required for kafka source and kafka sink.
rdkafka-cmakeThe same as rdkafka-plain, but is more portable. Requires cmake as a build dependency. Use it in case of compilation issues with rdkafka-plain.