fluentd(16)
-
Kubernetes에서 Slack Webhook을 안전하게 관리하는 방법 (Fluentd + Minecraft 알림)
Minecraft 서버 접속 로그를 기반으로 Slack 알림을 보내는 환경을 운영하던중, Slack Webhook URL이 Kubernetes manifest에 평문으로 포함된 문제를발견했다.처음에는 단순히 동작 여부만 확인했지만, 운영 환경에서는 보안과 관리방식이 더 중요하다.이 글에서는 실제 운영 환경에서 Webhook을 Git과 분리하고 안전하게 관리한방법을 정리한다.1. 기존 구조전체 흐름:Minecraft 로그 → Fluentd → 로그 필터 → Slack WebhookFluentd 설정 예시: @type slack webhook_url"#{ENV['SLACK_WEBHOOK_URL']}" {=html}2. 문제점기존 방식:kind: Secret stringData: webhook_url: "{=..
2026.04.25 -
Fluentd로 Slack 알림 연결하기 (Kubernetes + Minecraft 로그)
소개Kubernetes에서 특정 로그를 감지해 Slack으로 알림을 보내는 방법을 정리했습니다.예시는 Minecraft 로그의 joined the game 이벤트를 Slack으로 전달하는 구성입니다.1) Fluentd 이미지 준비Slack 플러그인을 포함한 Fluentd 이미지를 만듭니다.FROM fluent/fluentd:v1.16-1USER rootRUN fluent-gem install fluent-plugin-slack --no-document# Ruby 3.1 호환 shimRUN mkdir -p /fluentd/plugins \ && cat /fluentd/plugins/uri_unescape.rbrequire 'uri'unless URI.respond_to?(:unescape) modul..
2026.02.11 -
Fluentd 자꾸 elasticsearch와 연결이 끊어지고, 로그가 전송안 될때
logstash_format true # 문제가 생겼을 때 재 연결하게 함 reconnect_on_error true reload_connections true request_timeout 20s flush_mode interval flush_interval 5s retry_max_times 10 retry_wait 3s chunk_limit_size 8MB queue_limit_length 128 # buffer가 꽉 찼을 때 멈추게 함 overflow_action block
2025.02.09 -
Fluentd elasticsearch와 연결이 끊어질 때, buffer 설정
오류[warn]: #0 failed to flush the buffer. retry_times=0 next_retry_time=2025-02-06 14:46:28 +0900 chunk="62d72c2b628c703009>조치 @type elasticsearch host elasticsearch-host port 9200 logstash_format true flush_mode interval flush_interval 5s retry_max_times 10 retry_wait 3s chunk_limit_size 8MB queue_limit_length 128
2025.02.07 -
Fluentd nginx error 로그의 패턴이 일정하지 않을 때 처리
@type tail path /var/log/nginx/error.log pos_file /var/log/fluentd/nginx-error.log.pos tag nginx.error read_from_head true @type regexp expression /^(?\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}) \[(?[^\]]+)\] (?\d+#\d+): (?.*)$/ time_key time time_format %Y/%m/%d %H:%M:%S # Step 2: If Level is "error", extract structured fields @type record_transformer enable_ruby true reque..
2025.02.04 -
Fluentd 400 - Rejected by Elasticsearch
이 에러 때문에 개고생함[warn]: #0 dump an error event: error_class=Fluent::Plugin::ElasticsearchErrorHandler::ElasticsearchError error="400 - Rejected by Elasticsearch" location=nil tag="{tag}" time=2025-02-03 19:10:47.176780908 +0900 record={"request_id"=>"26567", .., "server_name"=>"test"}원인: Elasticsearch의 Index Templates에 에러와 관련된 Index 이름으로 Index Tempales이 등록되어 있었는데, 그것과 데이터 형식이 맞지 않아서 발생한 문제임결국 Elsti..
2025.02.04