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.
Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stableInstall compilation dependencies
Install C and C++ compilers (GCC or Clang) and GNU
make
if they are not pre-installed on your system.Download Vector's Source
- Latest (0.11.1)
- Master
mkdir -p vector && \curl -sSfL --proto '=https' --tlsv1.2 https://api.github.com/repos/timberio/vector/tarball/v0.11 | \tar xzf - -C vector --strip-components=1
Change into thevector
directorycd vectorCompile Vector
[FEATURES="<flag1>,<flag2>,..."] make buildThe
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 isx86_64-apple-darwin
, and the Vector binary will be located attarget/x86_64-apple-darwin/release/vector
.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 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.
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.
Feature | Description | Enabled by default |
---|---|---|
default | Default set of features for *-unknown-linux-gnu and *-apple-darwin targets. | |
default-cmake | Default set of features for *-unknown-linux-* targets which uses cmake and perl as build dependencies. | |
default-msvc | Default set of features for *-pc-windows-msvc targets. Requires cmake and perl as build dependencies. |
Alternatively, for finer control over dependencies and operating system features, it is possible to use specific features from the list below:
Feature | Description | Included in default feature |
---|---|---|
unix | Enables features that require cfg(unix) to be present on the platform, namely support for Unix domain sockets in docker_logs source and jemalloc instead of the default memory allocator. | |
vendored | Forces vendoring of OpenSSL and ZLib dependencies instead of using their versions installed in the system. Requires perl as a build dependency. | |
leveldb-plain | Enables support for disk buffers using vendored LevelDB. | |
leveldb-cmake | The 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-plain | Enables vendored librdkafka dependency, which is required for kafka source and kafka sink. | |
rdkafka-cmake | The same as rdkafka-plain , but is more portable. Requires cmake as a build dependency. Use it in case of compilation issues with rdkafka-plain . |
In addition, it is possible to pick only a subset of Vector's components for
the build using feature flags. In order to do it, it instead of default
features one has to pass a comma-separated list of component features.
Click to see all supported component features
Name | Description |
---|---|
sources-apache_metrics | Enables building of apache_metrics source. |
sources-aws_ecs_metrics | Enables building of aws_ecs_metrics source. |
sources-aws_kinesis_firehose | Enables building of aws_kinesis_firehose source. |
sources-aws_s3 | Enables building of aws_s3 source. |
sources-docker_logs | Enables building of docker_logs source. |
sources-file | Enables building of file source. |
sources-generator | Enables building of generator source. |
sources-heroku_logs | Enables building of heroku_logs source. |
sources-host_metrics | Enables building of host_metrics source. |
sources-http | Enables building of http source. |
sources-internal_logs | Enables building of internal_logs source. |
sources-internal_metrics | Enables building of internal_metrics source. |
sources-journald | Enables building of journald source. |
sources-kafka | Enables building of kafka source. Requires rdkafka-plain or rdkafka-cmake feature to be also enabled. |
sources-kubernetes_logs | Enables building of kubernetes_logs source. |
sources-mongodb_metrics | Enables building of mongodb_metrics source. |
sources-nginx_metrics | Enables building of nginx_metrics source. |
sources-prometheus_remote_write | Enables building of prometheus_remote_write source. |
sources-prometheus_scrape | Enables building of prometheus_scrape source. |
sources-socket | Enables building of socket source. |
sources-splunk_hec | Enables building of splunk_hec source. |
sources-statsd | Enables building of statsd source. |
sources-stdin | Enables building of stdin source. |
sources-syslog | Enables building of syslog source. |
sources-vector | Enables building of vector source. |
transforms-add_fields | Enables building of add_fields transform. |
transforms-add_tags | Enables building of add_tags transform. |
transforms-ansi_stripper | Enables building of ansi_stripper transform. |
transforms-aws_cloudwatch_logs_subscription_parser | Enables building of aws_cloudwatch_logs_subscription_parser transform. |
transforms-aws_ec2_metadata | Enables building of aws_ec2_metadata transform. |
transforms-coercer | Enables building of coercer transform. |
transforms-concat | Enables building of concat transform. |
transforms-dedupe | Enables building of dedupe transform. |
transforms-filter | Enables building of filter transform. |
transforms-geoip | Enables building of geoip transform. |
transforms-grok_parser | Enables building of grok_parser transform. |
transforms-json_parser | Enables building of json_parser transform. |
transforms-key_value_parser | Enables building of key_value_parser transform. |
transforms-log_to_metric | Enables building of log_to_metric transform. |
transforms-logfmt_parser | Enables building of logfmt_parser transform. |
transforms-lua | Enables building of lua transform. |
transforms-merge | Enables building of merge transform. |
transforms-metric_to_log | Enables building of metric_to_log transform. |
transforms-reduce | Enables building of reduce transform. |
transforms-regex_parser | Enables building of regex_parser transform. |
transforms-remap | Enables building of remap transform. |
transforms-remove_fields | Enables building of remove_fields transform. |
transforms-remove_tags | Enables building of remove_tags transform. |
transforms-rename_fields | Enables building of rename_fields transform. |
transforms-sampler | Enables building of sampler transform. |
transforms-split | Enables building of split transform. |
transforms-swimlanes | Enables building of swimlanes transform. |
transforms-tag_cardinality_limit | Enables building of tag_cardinality_limit transform. |
transforms-tokenizer | Enables building of tokenizer transform. |
transforms-wasm | Enables building of wasm transform. |
sinks-aws_cloudwatch_logs | Enables building of aws_cloudwatch_logs sink. |
sinks-aws_cloudwatch_metrics | Enables building of aws_cloudwatch_metrics sink. |
sinks-aws_kinesis_firehose | Enables building of aws_kinesis_firehose sink. |
sinks-aws_kinesis_streams | Enables building of aws_kinesis_streams sink. |
sinks-aws_s3 | Enables building of aws_s3 sink. |
sinks-aws_sqs | Enables building of aws_sqs sink. |
sinks-azure_monitor_logs | Enables building of azure_monitor_logs sink. |
sinks-blackhole | Enables building of blackhole sink. |
sinks-clickhouse | Enables building of clickhouse sink. |
sinks-console | Enables building of console sink. |
sinks-datadog_logs | Enables building of datadog_logs sink. |
sinks-datadog_metrics | Enables building of datadog_metrics sink. |
sinks-elasticsearch | Enables building of elasticsearch sink. |
sinks-file | Enables building of file sink. |
sinks-gcp_cloud_storage | Enables building of gcp_cloud_storage sink. |
sinks-gcp_pubsub | Enables building of gcp_pubsub sink. |
sinks-gcp_stackdriver_logs | Enables building of gcp_stackdriver_logs sink. |
sinks-honeycomb | Enables building of honeycomb sink. |
sinks-http | Enables building of http sink. |
sinks-humio_logs | Enables building of humio_logs sink. |
sinks-humio_metrics | Enables building of humio_metrics sink. |
sinks-influxdb_logs | Enables building of influxdb_logs sink. |
sinks-influxdb_metrics | Enables building of influxdb_metrics sink. |
sinks-kafka | Enables building of kafka sink. Requires rdkafka-plain or rdkafka-cmake feature to be also enabled. |
sinks-logdna | Enables building of logdna sink. |
sinks-loki | Enables building of loki sink. |
sinks-nats | Enables building of nats sink. |
sinks-new_relic_logs | Enables building of new_relic_logs sink. |
sinks-papertrail | Enables building of papertrail sink. |
sinks-prometheus_exporter | Enables building of prometheus_exporter sink. |
sinks-prometheus_remote_write | Enables building of prometheus_remote_write sink. |
sinks-pulsar | Enables building of pulsar sink. |
sinks-sematext_logs | Enables building of sematext_logs sink. |
sinks-sematext_metrics | Enables building of sematext_metrics sink. |
sinks-socket | Enables building of socket sink. |
sinks-splunk_hec | Enables building of splunk_hec sink. |
sinks-statsd | Enables building of statsd sink. |
sinks-vector | Enables building of vector sink. |