57 lines
1.5 KiB
YAML
57 lines
1.5 KiB
YAML
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: fluent-bit-config
|
|
namespace: fluent-bit
|
|
labels:
|
|
app.kubernetes.io/name: fluentbit
|
|
data:
|
|
fluent-bit.conf: |
|
|
[SERVICE]
|
|
Flush 5
|
|
Log_Level warn
|
|
Daemon off
|
|
Parsers_File parsers.conf
|
|
storage.path /var/fluent-bit/state/flb-storage/
|
|
storage.sync normal
|
|
storage.checksum off
|
|
storage.backlog.mem_limit 5M
|
|
|
|
@INCLUDE userapp-log.conf
|
|
|
|
userapp-log.conf: |
|
|
[INPUT]
|
|
Name tail
|
|
Parser cri
|
|
Path /var/log/containers/pub-*-dp-*-*_nnd-logging_*-con-*.log
|
|
DB /var/fluent-bit/state/flb_log.db
|
|
Tag pub.<service_name>
|
|
Tag_Regex /pub-(?<service_name>.+)-dp-[^-]+-[^-]+_nnd_logging_.+-con-[^-]+.log$
|
|
Mem_Buf_Limit 5MB
|
|
Skip_Long_Lines On
|
|
Refresh_Interval 10
|
|
|
|
[OUTPUT]
|
|
Name es
|
|
Host 10.1.81.11
|
|
Port 9200
|
|
Match pub.*
|
|
HTTP_User admin
|
|
HTTP_Passwd ijinc123!
|
|
Index pub_injeinc_os
|
|
Type _doc
|
|
Include_Tag_Key true
|
|
Tag_key @svc_name
|
|
Suppress_Type_Name On
|
|
|
|
|
|
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
|
|
Decode_Field_As json message
|
|
|