GPU-Live/template/gyeonggi/fluentbit_v3.1.7/2_configmap/fileSave.yaml

74 lines
2.1 KiB
YAML

apiVersion: v1
kind: ConfigMap
metadata:
name: fluent-bit
namespace: logging
labels:
app.kubernetes.io/name: fluentbit
app.kubernetes.io/instance: fluent-bit
app.kubernetes.io/version: "3.1.7"
data:
custom_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
[PARSER]
Name svcname
Format regex
Regex /sample-(?<servicename>.+)-dp-[^-]+-[^-]+_(?<namespace>.+)_.+-con-[^-]+.log$
fluent-bit.conf: |
[SERVICE]
Flush 5
Log_Level info
Daemon off
Parsers_File /fluent-bit/etc/parsers.conf
Parsers_File /fluent-bit/etc/conf/custom_parsers.conf
HTTP_Server On
HTTP_Listen 0.0.0.0
HTTP_Port 2020
Health_Check On
storage.path /var/fluent-bit/state/flb-storage/
storage.sync normal
storage.checksum off
storage.backlog.mem_limit 5M
@INCLUDE input-kubernetes.conf
# @INCLUDE filter-kubernetes.conf
@INCLUDE output-file.conf
input-kubernetes.conf: |
[INPUT]
Name tail
Parser cri
Path /var/log/containers/blog-*-dp-*-*_blog_*-con-*.log
DB /var/fluent-bit/state/flb_log.db
Tag blog.<service_name>
Tag_Regex /blog-(?<service_name>.+)-dp-[^-]+-[^-]+_blog_.+-con-[^-]+.log$
Mem_Buf_Limit 5MB
Skip_Long_Lines On
Refresh_Interval 10
Path_key svc_name
filter-kubernetes.conf: |
[FILTER]
Name parser
Match blog.*
Key_name svc_name
reserve_data On
Parser svcname
output-file.conf: |
[OUTPUT]
Name file
Match blog.*
Path /home/ubuntu
file fluentbit-scrape.txt