-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfilebeat-docker.yml
More file actions
105 lines (96 loc) · 2.41 KB
/
filebeat-docker.yml
File metadata and controls
105 lines (96 loc) · 2.41 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
filebeat.inputs:
# HyperCache application logs from shared volume
- type: log
enabled: true
paths:
- /var/log/hypercache/node-*.log
json.keys_under_root: true
json.add_error_key: true
fields:
hypercache_service: hypercache
environment: docker
log_type: application
fields_under_root: true
# Docker container logs - only HyperCache node containers
- type: container
enabled: true
paths:
- '/var/lib/docker/containers/*/*.log'
fields:
hypercache_service: hypercache
environment: docker
log_type: container
fields_under_root: true
processors:
# Add Docker metadata
- add_docker_metadata:
host: "unix:///var/run/docker.sock"
# Drop logs from non-HyperCache-node containers (Grafana, Elasticsearch, Filebeat, volume-init)
- drop_event:
when:
not:
regexp:
container.name: "^hypercache-node[0-9]+$"
# Extract node ID from container name
- script:
lang: javascript
source: >
function process(event) {
var container = event.Get("container");
if (container && container.name && typeof container.name === 'string') {
if (container.name.indexOf("hypercache-") === 0) {
event.Put("hypercache.node_id", container.name.replace("hypercache-", ""));
}
}
}
output.elasticsearch:
hosts: ["hypercache-elasticsearch:9200"]
index: "hypercache-logs-%{+yyyy.MM.dd}"
template.enabled: true
template.pattern: "hypercache-logs-*"
setup.template.enabled: true
setup.template.name: "hypercache-logs"
setup.template.pattern: "hypercache-logs-*"
setup.template.settings:
index.number_of_shards: 1
index.number_of_replicas: 0
# Index lifecycle management
setup.ilm.enabled: true
setup.ilm.rollover_alias: "hypercache-logs"
setup.ilm.pattern: "{now/d}-000001"
setup.ilm.policy: |
{
"policy": {
"phases": {
"hot": {
"actions": {
"rollover": {
"max_size": "1GB",
"max_age": "1d"
}
}
},
"warm": {
"min_age": "7d",
"actions": {
"allocate": {
"number_of_replicas": 0
}
}
},
"delete": {
"min_age": "30d"
}
}
}
}
logging.level: info
logging.to_files: true
logging.files:
path: /var/log/filebeat
name: filebeat
keepfiles: 7
permissions: 0644
http.enabled: true
http.host: 0.0.0.0
http.port: 5066