-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigmap.yaml
95 lines (90 loc) · 3.02 KB
/
configmap.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
89
90
91
92
93
94
95
apiVersion: v1
kind: ConfigMap
metadata:
name: fluent-bit-config
namespace: elastic
labels:
k8s-app: fluent-bit
data:
fluent-bit.conf: |
[SERVICE]
Flush 5
Log_Level debug
Daemon off
Parsers_File parsers.conf
HTTP_Server On
HTTP_Listen 0.0.0.0
HTTP_Port 2020
# Logging 파이프라인
@INCLUDE input-kubernetes.conf
@INCLUDE filter-kubernetes.conf
@INCLUDE output-elasticsearch.conf
input-kubernetes.conf: |
[INPUT]
Name tail
Path /var/log/containers/*_kube-system_*.log
# Path에서 수집되는 데이터 태깅
Tag kube.*
Read_from_head true
Parser cri
[INPUT]
Name tail
Tag shop.*
Path /var/log/containers/*_shop_*.log
Multiline on
Read_from_head true
Parser_Firstline multiline_pattern
filter-kubernetes.conf: |
[FILTER]
Name kubernetes
# 모든 태그에 대해 kubernetes Filtering 처리. (k8s 메타정보로 Log Enrichment)
Match *
Kube_URL https://kubernetes.default.svc:443
Kube_CA_File /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
Kube_Token_File /var/run/secrets/kubernetes.io/serviceaccount/token
Kube_Tag_Prefix kube.var.log.containers.
Merge_Log On
Merge_Log_Key log_processed
K8S-Logging.Parser On
K8S-Logging.Exclude Off
[FILTER]
Name multiline
Match shop.*
multiline.key_content log
multiline.parser java
output-elasticsearch.conf: |
[OUTPUT]
Name es
Match kube.*
Host ${FLUENT_ELASTICSEARCH_HOST}
Port ${FLUENT_ELASTICSEARCH_PORT}
# kubernetes Sys 로그의 Index Name 설정
Index fluent-k8s
Type flb_type
Logstach_Format On
Logstach_Prefix fluent-k8s
Retry_Limit False
[OUTPUT]
Name es
Match shop.*
Host ${FLUENT_ELASTICSEARCH_HOST}
Port ${FLUENT_ELASTICSEARCH_PORT}
# shop 네임스페이스 로그의 Index Name 설정
Index fluent-shop
Type flb_type
Logstach_Format On
Logstach_Prefix fluent-shop
Retry_Limit False
parsers.conf: |
[PARSER]
Name cri
Format regex
Regex ^(?<time>[^ ]+) (?<stream>stdout|stderr) (?<logtag>[^ ]*) (?<message>.*)$
Time_Key time
Time_Format %Y-%m-%dT%H:%M:%S.%L%z
[PARSER]
Name multiline_pattern
Format regex
Regex ^\[(?<timestamp>[0-9]{2,4}\-[0-9]{1,2}\-[0-9]{1,2} [0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2})\] (?<message>.*)
Time_Key time
Time_Format %Y-%m-%