1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-28 09:08:36 +02:00

update fluent-bit

This commit is contained in:
kev 2024-11-18 12:15:55 +08:00
parent 3261510293
commit 89a9c30251
3 changed files with 14 additions and 1 deletions

View File

@ -11,6 +11,7 @@ $ mkdir -p data/{etc,var}
$ wget -P data/etc https://github.com/fluent/fluent-bit/raw/master/conf/fluent-bit.conf \ $ wget -P data/etc https://github.com/fluent/fluent-bit/raw/master/conf/fluent-bit.conf \
https://github.com/fluent/fluent-bit/raw/master/conf/parsers.conf \ https://github.com/fluent/fluent-bit/raw/master/conf/parsers.conf \
https://github.com/fluent/fluent-bit/raw/master/conf/plugins.conf https://github.com/fluent/fluent-bit/raw/master/conf/plugins.conf
$ vim data/etc/fluent-bit.conf
$ docker-compose up -d $ docker-compose up -d
$ docker-compose logs --tail 10 -f $ docker-compose logs --tail 10 -f
``` ```

View File

@ -38,6 +38,10 @@
Time_Key time Time_Key time
Time_Format %d/%b/%Y:%H:%M:%S %z Time_Format %d/%b/%Y:%H:%M:%S %z
[PARSER]
Name logfmt
Format logfmt
[PARSER] [PARSER]
Name docker Name docker
Format json Format json
@ -124,3 +128,11 @@
Name kube-custom Name kube-custom
Format regex Format regex
Regex (?<tag>[^.]+)?\.?(?<pod_name>[a-z0-9](?:[-a-z0-9]*[a-z0-9])?(?:\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_(?<namespace_name>[^_]+)_(?<container_name>.+)-(?<docker_id>[a-z0-9]{64})\.log$ Regex (?<tag>[^.]+)?\.?(?<pod_name>[a-z0-9](?:[-a-z0-9]*[a-z0-9])?(?:\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_(?<namespace_name>[^_]+)_(?<container_name>.+)-(?<docker_id>[a-z0-9]{64})\.log$
[PARSER]
# Examples: TCP: https://rubular.com/r/Q8YY6fHqlqwGI0 UDP: https://rubular.com/r/B0ID69H9FvN0tp
Name kmsg-netfilter-log
Format regex
Regex ^\<(?<pri>[0-9]{1,5})\>1 (?<time>[^ ]+) (?<host>[^ ]+) kernel - - - \[[0-9\.]*\] (?<logprefix>[^ ]*)\s?IN=(?<in>[^ ]*) OUT=(?<out>[^ ]*) MAC=(?<macsrc>[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}):(?<macdst>[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}):(?<ethtype>[0-9a-f]{2}:[0-9a-f]{2}) SRC=(?<saddr>[^ ]*) DST=(?<daddr>[^ ]*) LEN=(?<len>[^ ]*) TOS=(?<tos>[^ ]*) PREC=(?<prec>[^ ]*) TTL=(?<ttl>[^ ]*) ID=(?<id>[^ ]*) (D*F*)\s*PROTO=(?<proto>[^ ]*)\s?((SPT=)?(?<sport>[0-9]*))\s?((DPT=)?(?<dport>[0-9]*))\s?((LEN=)?(?<protolen>[0-9]*))\s?((WINDOW=)?(?<window>[0-9]*))\s?((RES=)?(?<res>0?x?[0-9]*))\s?(?<flag>[^ ]*)\s?((URGP=)?(?<urgp>[0-9]*))
Time_Key time
Time_Format %Y-%m-%dT%H:%M:%S.%L%z

View File

@ -1,7 +1,7 @@
version: "3.8" version: "3.8"
services: services:
fluent-bit: fluent-bit:
image: fluent/fluent-bit:2.1 image: fluent/fluent-bit:3.2
ports: ports:
- "2020:2020" - "2020:2020"
volumes: volumes: