-
Notifications
You must be signed in to change notification settings - Fork 183
Expand file tree
/
Copy pathvector.yaml
More file actions
136 lines (119 loc) · 3.7 KB
/
Copy pathvector.yaml
File metadata and controls
136 lines (119 loc) · 3.7 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Copyright (c) 2025 Zededa, Inc.
# SPDX-License-Identifier: Apache-2.0
---
data_dir: "${VECTOR_DATA_DIR:-/var/lib/vector}" # where Vector stores its data files (mostly buffers)
sources:
dev_keep:
type: socket
mode: unix_stream
path: "${DEV_KEEP_SOURCE_SOCK:-/run/devKeep_source.sock}"
dev_upload:
type: socket
mode: unix_stream
path: "${DEV_UPLOAD_SOURCE_SOCK:-/run/devUpload_source.sock}"
vector_metrics:
type: internal_metrics
transforms:
parse_json_keep:
type: remap
inputs:
- dev_keep
source: |
. = parse_json!(.message)
parse_json_upload:
type: remap
inputs:
- dev_upload
source: |
. = parse_json!(.message)
# Here you can add any transforms that you need,
# all transforms from https://vector.dev/docs/reference/configuration/transforms/
# are supported.
# Some example transforms that you might want to use:
# # this transform throttles the rate of error events to 1 per minute
# # per event (unique) based on the `filename` field
# throttle_errors:
# type: throttle
# inputs:
# - parse_json_keep
# threshold: 1
# window_secs: 60
# exclude: .severity != "error"
# key_field: "{{ filename }}"
# internal_metrics:
# emit_events_discarded_per_key: true
# # this transform drops hardware health errors that match a specific pattern
# drop_hwhealth_errors:
# type: filter
# inputs:
# - parse_json_upload
# condition: |
# # Safely get .content as a string (empty if missing/invalid)
# c = to_string(.content) ?? "";
# cont = parse_json(c) ?? null;
# if is_null(cont) {
# # If parsing failed, we can't filter it out, so keep it.
# return true;
# } else {
# # Drop any line mentioning “All attempts to connect to …hardwarehealth failed”
# # by _negating_ a regex match:
# m = to_string(cont.msg) ?? "";
# !match(m, r'All attempts to connect to .*hardwarehealth failed')
# }
# # this transform lets through only error events
# filter_errors:
# type: filter
# inputs:
# - parse_json_upload
# condition: |
# # Filter out events that are not errors.
# # This assumes the JSON has a field `severity` that indicates the log level.
# .severity == "error" || .severity == "err" || .severity == "critical" || .severity == "fatal"
# # this transform deduplicates events based on the `content` field
# dedup_upload:
# type: dedupe
# inputs:
# - filter_errors
# fields.match:
# - "content" # deduplicate based on the `content` field
# # this transform filters out events that do not start with "vector" or "newlog"
# filter_upload:
# type: filter
# inputs:
# - dedup_upload
# condition: |
# # Coerce `.source` to a string; if it fails, use "".
# src = to_string(.source) ?? "";
# # Now `src` is always a valid string (possibly empty).
# # starts_with(src, "vector") || starts_with(src, "newlog")
sinks:
keep_sent_queue_socket:
type: socket
inputs:
- parse_json_keep
mode: unix_stream
path: "${DEV_KEEP_SINK_SOCK:-/run/devKeep_sink.sock}"
encoding:
codec: json # write events as JSON objects
buffer:
type: disk
max_size: 268435488 # 256 MB
when_full: block
dev_upload_socket:
type: socket
inputs:
- parse_json_upload
mode: unix_stream
path: "${DEV_UPLOAD_SINK_SOCK:-/run/devUpload_sink.sock}"
encoding:
codec: json
buffer:
type: disk
max_size: 268435488 # 256 MB
when_full: block
prometheus:
type: prometheus_exporter
inputs:
- vector_metrics
address: "127.0.0.1:8889"
namespace: "vector"