forked from naveedkhan1998/alpaca-main
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvector.toml
More file actions
45 lines (40 loc) · 1.07 KB
/
Copy pathvector.toml
File metadata and controls
45 lines (40 loc) · 1.07 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
# 1) Source: Docker API
[sources.docker]
type = "docker_logs"
# Simple filter to exclude logging infrastructure
[transforms.filter_real_logs]
type = "filter"
inputs = ["docker"]
condition = '''
!contains(string!(.container_name), "alpaca-vector") &&
!contains(string!(.container_name), "alpaca-loki") &&
!contains(string!(.container_name), "alpaca-grafana")
'''
# Optional: parse JSON if your apps log structured messages
[transforms.parse_json]
type = "remap"
inputs = ["filter_real_logs"]
source = '''
# Add container info and try to parse JSON
.container = .container_name
.structured, err = parse_json(.message)
if err == null && is_object(.structured) {
., merge_err = merge(., .structured)
}
'''
# 2) Sink: Loki
[sinks.loki]
type = "loki"
inputs = ["parse_json"]
endpoint = "http://alpaca-loki:3100"
encoding.codec = "json"
# Attach useful labels
labels.container = "{{ container_name }}"
labels.image = "{{ image }}"
labels.stack_env = "local"
# Add console sink for debugging
[sinks.console]
type = "console"
inputs = ["parse_json"]
encoding.codec = "json"
target = "stdout"