본문 바로가기

인프라,데이터/Fluentd, Fluent Bit

(12)
Remove last n characters using Regex & Fluent Bit I took a quite a munutes to find "remove / delete last n characters / words by regex" but there was no explicit answer. However, I found a solution. [FILTER] Name parser Match test.* Key_Name path Parser removelastn Reserve_Data On Preserve_key On [PARSER] Name removelastn Format regex Regex (?.*?).{6}$ link (?.*?) means "log" might not exist, anyway it catch all characters or nothing("") .{6}$ ..
Kubernetes - Fluent Bit 로 사용자 로그 S3에 output 설정하기 부제 : 온갖 예외 케이스를 가정하여 사용자 로그의 S3 경로 잡기 1. Fluent Bit에서 S3으로 output 보내기 Fluent Bit 에서 S3 output을 쓰는 건 쉽다. [OUTPUT] Name s3 Match * bucket my-bucket region us-west-2 s3_key_format /$TAG[2]/$TAG[0]/%Y/%m/%d/$UUID.gz s3_key_format_tag_delimiters .- 이렇게 s3 output 설정을 넣어주고 butket과 key format을 지정해주면 된다. 나의 경우는 EKS 안의 애플리케이션에서 발생한 사용자 로그를 시스템 로그(var/log/containers/$podname~.log 식으로 저장되는 파드의 로그)와 분리하여 S3 ..
Fluent Bit Stream Processor 사용하여 데이터 특정 조건에 따라 다른 아웃풋으로 보내기 fluent-bit.conf: | [SERVICE] Flush 5 Log_Level info Daemon off Parsers_File parsers.conf Streams_File streams.conf HTTP_Server On HTTP_Listen 0.0.0.0 HTTP_Port 2020 먼저 [SERVICE]에 Streams_File 을 기재해줍니다. streams.conf: | [STREAM_TASK] Name check_one Exec CREATE STREAM three_check WITH (tag='userlog.*') AS SELECT * FROM TAG:'userlog.*' WHERE cluster_name = " " and pod_namespace = " " and pod_name = ..
Fluent Bit에서 특정 경로의 로그 파일 받아와 쿠버네티스 메타데이터 추가하기 한줄 미리보기 : 제목처럼 안 됩니다. 이거 되게 하려고 몇 시간을 허비했는지..... 저같이 '이거 설정 좀만 바꾸면 되는 거 아냐?' 하고 매달리실 분들을 위해 씁니다... 환경 : EKS (쿠버네티스 버전 1.8) fluent bit : latest fluent bit의 tail의 인풋 설정은 다음과 같은데, [INPUT] Name tail Tag kube.* Path /var/log/containers/*.log 여기서 Path를 /var/log/containers/custom-*.log 와 같이 조금이라도 바꾸면... 쿠버네티스 메타정보가 추가되지 않습니다. 시스템 로그(var/log/containers/~ 하위의 podname별로 생기는 {podname}_{namespace}_{containe..