forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenv-vars.md.erb
49 lines (33 loc) · 1.2 KB
/
env-vars.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
title: Environment Variables
description: "A full list of Vector's supported environment variables and how to use them."
sidebar_label: Env Vars
---
You can control Vector's behavior through select environment variables:
```bash
ENV_VAR1=val ENV_VAR2=val vector --config=/etc/vector/vector.toml
```
In addition, we recommend that you look at the [global configuration
options][docs.global-options] as well.
## Special Variables
<%= fields(metadata.env_vars_list, heading_depth: 3) %>
## Custom Variables
As noticed in the [configuration document][docs.configuration#environment-variables],
Vector supports custom environment variables via the `${...}` syntax:
```toml
option = "${ENV_VAR}"
```
<Alert type="info">
Interpolation is done before parsing the configuration file. This is done when
[starting][docs.process-management#starting] and
[reloading][docs.process-management#reloading] Vector.
</Alert>
### Default Values
Default values can be supplied via the `:-` syntax:
```toml
option = "${ENV_VAR:-default}"
```
### Escaping
You can escape environment variable by preceding them with a `$` character. For
example `$${HOSTNAME}` will be treated _literally_ in the above environment
variable example.