Skip to content

Commit bd94cb0

Browse files
committed
Improve code organization and readability
1 parent 255be97 commit bd94cb0

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

charts/templates/configmap.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,14 @@ data:
2121
[SERVICE]
2222
Flush 5
2323
Log_Level info
24-
Parsers_File parsers.conf
2524
Daemon off
25+
Parsers_File parsers.conf
26+
27+
@INCLUDE inputs.conf
28+
@INCLUDE filters.conf
29+
@INCLUDE outputs.conf
2630
31+
inputs.conf: |
2732
[INPUT]
2833
Name tail
2934
Path {{ .Values.persistence.mountPath }}/Logs/*Error*
@@ -58,11 +63,14 @@ data:
5863
Read_from_head true
5964
tag kube.marklogic.logs.audit
6065
Path_Key path
61-
66+
67+
filters.conf: |
68+
# Enrich Logs
6269
[FILTER]
6370
Name modify
6471
Match *
6572
Add pod ${POD_NAME}
73+
Add namespace {{ .Release.Namespace }}
6674
6775
[FILTER]
6876
Name modify
@@ -88,7 +96,8 @@ data:
8896
Name modify
8997
Match kube.marklogic.logs.crash
9098
Add tag kube.marklogic.logs.crash
91-
99+
100+
# Parse Logs
92101
[FILTER]
93102
Name parser
94103
Match kube.marklogic.logs.error
@@ -110,6 +119,7 @@ data:
110119
Parser json_parser
111120
Reserve_Data On
112121
122+
outputs.conf: |
113123
# Configure export to logging backend
114124
[OUTPUT]
115125
Name es
@@ -118,20 +128,21 @@ data:
118128
Port {{ .Values.logging.port }}
119129
HTTP_User {{ .Values.logging.username }}
120130
HTTP_Passwd {{ .Values.logging.password }}
131+
121132
parsers.conf: |
122133
[PARSER]
123134
Name error_parser
124135
Format regex
125136
Regex ^(?<date_time>(.+?)(?=[a-zA-Z]))(?<log_level>(.+?)(?=:))(.+?)(?=[a-zA-Z])(?<log>.*)
126-
Time_Key date_time
137+
Time_Key time
127138
Time_Format %Y-%m-%d %H:%M:%S.%L
128139
Time_Keep On
129140
130141
[PARSER]
131142
Name access_parser
132143
Format regex
133144
Regex ^(?<host>[^ ]*)(.+?)(?<=\- )(?<user>(.+?)(?=\[))(.+?)(?<=\[)(?<date_time>(.+?)(?=\]))(.+?)(?<=")(?<request>[^\ ]+[^\"]+)(.+?)(?=\d)(?<response_code>[^\ ]*)(.+?)(?=\d|-)(?<response_obj_size>[^\ ]*)(.+?)(?=")(?<request_info>.*)
134-
Time_Key date_time
145+
Time_Key time
135146
Time_Format %d/%b/%Y:%H:%M:%S %z
136147
Time_Keep On
137148

charts/templates/statefulset.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,7 @@ spec:
107107
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
108108
{{- end }}
109109
- name: {{ .Values.logging.configMapName }}
110-
mountPath: /fluent-bit/etc/fluent-bit.conf
111-
subPath: fluent-bit.conf
112-
- name: {{ .Values.logging.configMapName }}
113-
mountPath: /fluent-bit/etc/parsers.conf
114-
subPath: parsers.conf
110+
mountPath: /fluent-bit/etc/
115111
env:
116112
- name: POD_NAME
117113
valueFrom:

0 commit comments

Comments
 (0)