-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfluentd-es-config.yaml
88 lines (88 loc) · 2.25 KB
/
fluentd-es-config.yaml
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
kind: ConfigMap
apiVersion: v1
metadata:
name: fluentd-es-config
namespace: kube-system
data:
containers.input.conf: |-
<source>
@type tail
path /var/log/containers/*.log
exclude_path ["/var/log/containers/*fluentd*"]
pos_file /var/log/es-containers.log.pos
tag kubernetes.*
read_from_head true
<parse>
@type multi_format
<pattern>
format json
time_key time
time_format %Y-%m-%dT%H:%M:%S.%NZ
</pattern>
<pattern>
format regexp
expression /^(?<time>.+) (?<stream>stdout|stderr) [^ ]* (?<log>.*)$/
time_format %Y-%m-%dT%H:%M:%S.%N%:z
</pattern>
</parse>
</source>
forward.input.conf: |-
# Takes the messages sent over TCP
<source>
@type forward
</source>
monitoring.conf: |-
# Prometheus Exporter Plugin
# input plugin that exports metrics
<source>
@type prometheus
</source>
<source>
@type monitor_agent
</source>
# input plugin that collects metrics from MonitorAgent
<source>
@type prometheus_monitor
<labels>
host ${hostname}
</labels>
</source>
# input plugin that collects metrics for output plugin
<source>
@type prometheus_output_monitor
<labels>
host ${hostname}
</labels>
</source>
# input plugin that collects metrics for in_tail plugin
<source>
@type prometheus_tail_monitor
<labels>
host ${hostname}
</labels>
</source>
output.conf: |-
# Enriches records with Kubernetes metadata
<filter kubernetes.**>
@type kubernetes_metadata
</filter>
<match **>
@type elasticsearch_dynamic
@log_level info
include_tag_key true
host elasticsearch-logging
port 9200
logstash_format true
logstash_dateformat %Y.%m.%d-%H
logstash_prefix ${record['kubernetes']['namespace_name']}
type_name kubernetes-without-namespace
target_index_key kubernetes-without-namespace
<buffer>
flush_thread_count 4
flush_interval 5s
retry_forever
retry_max_interval 30
chunk_limit_size 4M
queue_limit_length 8
</buffer>
</match>