Loading .gitlab-ci.yml +1 −5 Original line number Diff line number Diff line Loading @@ -6,10 +6,6 @@ include: stages: - deploy variables: PROJECT_PARENT_NAME: log .deploy: variables: STACK: ${PROJECT_PARENT_NAME} SERVICES_TO_CHECK: ${PROJECT_PARENT_NAME}_${CI_PROJECT_NAME} STACK: log README.md +1 −1 Original line number Diff line number Diff line # Fluent Bit Configure and deploy Fluent Bit, a lightweight service to feed Fluentd Configure and deploy Fluent Bit, a lightweight service to ingest logs and feed Loki deploy/.env +3 −0 Original line number Diff line number Diff line LOG_LEVEL=info INPUT_TAG_PREFIX=docker. PORT=24224 deploy/conf/fluent-bit.conf +20 −7 Original line number Diff line number Diff line [SERVICE] Flush 5 Daemon off Log_Level info flush 1 log_level ${LOG_LEVEL} [INPUT] Name forward name forward [FILTER] name rewrite_tag match ${INPUT_TAG_PREFIX}* rule $container_name ^\/([^_]+)_([^.]+)\.(\d+)\.(.*)$ loki.$1.$2.$3.$4 false [FILTER] name record_modifier match loki.* remove_key source remove_key container_name [OUTPUT] Name forward Match * Host fluentd name loki match loki.* host loki labels stack_name=$TAG[1], service_name=$TAG[1]_$TAG[2], slot=$TAG[3], container_name=$TAG[1]_$TAG[2].$TAG[3].$TAG[4] label_keys $container_id drop_single_key true deploy/docker-compose.tmpl.yml +7 −4 Original line number Diff line number Diff line Loading @@ -3,6 +3,9 @@ version: '3.5' services: fluent-bit: image: ${IMAGE_NAME:-fluent/fluent-bit}:${IMAGE_TAG:-latest} environment: LOG_LEVEL: INPUT_TAG_PREFIX: networks: log-net: ports: Loading @@ -10,7 +13,7 @@ services: published: ${PORT} mode: host configs: - source: fluent-bit-conf - source: fluent-bit target: /fluent-bit/etc/fluent-bit.conf logging: driver: json-file Loading @@ -19,7 +22,7 @@ services: restart_policy: delay: ${RESTART_DELAY:-1s} update_config: delay: ${UPDATE_DELAY:-10s} delay: ${UPDATE_DELAY:-1s} resources: limits: cpus: '${RESOURCES_LIMITS_CPUS:-0.1}' Loading @@ -35,6 +38,6 @@ networks: attachable: ${LOG_NET_ATTACHABLE:-true} configs: fluent-bit-conf: name: ${FLUENT_BIT_CONF_NAME:-fluent-bit-conf} fluent-bit: name: ${FLUENT_BIT_CONFIG_NAME:-fluent-bit-conf} file: ./conf/fluent-bit.conf Loading
.gitlab-ci.yml +1 −5 Original line number Diff line number Diff line Loading @@ -6,10 +6,6 @@ include: stages: - deploy variables: PROJECT_PARENT_NAME: log .deploy: variables: STACK: ${PROJECT_PARENT_NAME} SERVICES_TO_CHECK: ${PROJECT_PARENT_NAME}_${CI_PROJECT_NAME} STACK: log
README.md +1 −1 Original line number Diff line number Diff line # Fluent Bit Configure and deploy Fluent Bit, a lightweight service to feed Fluentd Configure and deploy Fluent Bit, a lightweight service to ingest logs and feed Loki
deploy/.env +3 −0 Original line number Diff line number Diff line LOG_LEVEL=info INPUT_TAG_PREFIX=docker. PORT=24224
deploy/conf/fluent-bit.conf +20 −7 Original line number Diff line number Diff line [SERVICE] Flush 5 Daemon off Log_Level info flush 1 log_level ${LOG_LEVEL} [INPUT] Name forward name forward [FILTER] name rewrite_tag match ${INPUT_TAG_PREFIX}* rule $container_name ^\/([^_]+)_([^.]+)\.(\d+)\.(.*)$ loki.$1.$2.$3.$4 false [FILTER] name record_modifier match loki.* remove_key source remove_key container_name [OUTPUT] Name forward Match * Host fluentd name loki match loki.* host loki labels stack_name=$TAG[1], service_name=$TAG[1]_$TAG[2], slot=$TAG[3], container_name=$TAG[1]_$TAG[2].$TAG[3].$TAG[4] label_keys $container_id drop_single_key true
deploy/docker-compose.tmpl.yml +7 −4 Original line number Diff line number Diff line Loading @@ -3,6 +3,9 @@ version: '3.5' services: fluent-bit: image: ${IMAGE_NAME:-fluent/fluent-bit}:${IMAGE_TAG:-latest} environment: LOG_LEVEL: INPUT_TAG_PREFIX: networks: log-net: ports: Loading @@ -10,7 +13,7 @@ services: published: ${PORT} mode: host configs: - source: fluent-bit-conf - source: fluent-bit target: /fluent-bit/etc/fluent-bit.conf logging: driver: json-file Loading @@ -19,7 +22,7 @@ services: restart_policy: delay: ${RESTART_DELAY:-1s} update_config: delay: ${UPDATE_DELAY:-10s} delay: ${UPDATE_DELAY:-1s} resources: limits: cpus: '${RESOURCES_LIMITS_CPUS:-0.1}' Loading @@ -35,6 +38,6 @@ networks: attachable: ${LOG_NET_ATTACHABLE:-true} configs: fluent-bit-conf: name: ${FLUENT_BIT_CONF_NAME:-fluent-bit-conf} fluent-bit: name: ${FLUENT_BIT_CONFIG_NAME:-fluent-bit-conf} file: ./conf/fluent-bit.conf