forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenvironment_variables.yaml
More file actions
38 lines (35 loc) · 1.2 KB
/
environment_variables.yaml
File metadata and controls
38 lines (35 loc) · 1.2 KB
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
# Environment Variables Example
# ------------------------------------------------------------------------------
# A simple example that demonstrates Vector's environment variable
# interpolation syntax. More information can be found in the Environment
# Variables section in our docs:
#
# https://vector.dev/docs/setup/configuration#environment-variables
data_dir: "/var/lib/vector"
# Ingests Apache 2 log data by tailing one or more log files
# Example: 194.221.90.140 - - [22/06/2019:11:55:14 -0400] "PUT /integrate" 100 2213
# Docs: https://vector.dev/docs/reference/configuration/sources/file
sources:
apache_logs:
type: "file"
include: [ "/var/log/apache2/*.log" ]
# ignore files older than 1 day
ignore_older_secs: 86400
# Add a field based on the value of the HOSTNAME env var
# Docs: https://vector.dev/docs/reference/configuration/transforms/remap
transforms:
add_host:
inputs: [ "apache_logs" ]
type: "remap"
source: |
'''
.host = get_env_var!("HOSTNAME")
'''
# Print the data to STDOUT for inspection
# Docs: https://vector.dev/docs/reference/configuration/sinks/console
sinks:
out:
inputs: [ "add_host" ]
type: "console"
encoding:
codec: "json"