LOG

sampler transform

The sampler transform accepts log events and allows you to sample events with a configurable rate.

Configuration

vector.toml
[transforms.my_transform_id]
# REQUIRED
type = "sampler" # example, must be: "sampler"
inputs = ["my-source-id"] # example
rate = 10 # example
# OPTIONAL
pass_list = ["[error]", "field2"] # example, no default

Options

2 items
common[string]optional

pass_list

A list of regular expression patterns to exclude events from sampling. If an event's "message" key matches any of these patterns it will not be sampled.

No default
View examples
commonintrequired

rate

The rate at which events will be forwarded, expressed as 1/N. For example, rate = 10 means 1 out of every 10 events will be forwarded and the rest will be dropped.

No default
View examples

How It Works

Environment Variables

Environment variables are supported through all of Vector's configuration. Simply add ${MY_ENV_VAR} in your Vector configuration file and the variable will be replaced before being evaluated.

You can learn more in the Environment Variables section.