Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

fluentd

БесплатноБез исполняемых скриптовНе проверен

Configure Fluentd for unified log collection, routing, filtering, and forwarding across distributed systems. Use when a user needs to aggregate logs from…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

Fluentd

Overview

Set up Fluentd as a unified logging layer to collect, filter, transform, and forward logs from applications, containers, and infrastructure to various backends. Covers configuration, plugins, Kubernetes DaemonSet deployment, and buffering strategies.

Current release: Fluentd 1.20.0 (2026-10-23). It is distributed as the fluent/fluentd Docker image (v1.20-debian-1; the image holds only core plugins), as the fluent-package OS packages (installs to /opt/fluent, plugins added with fluent-gem install), and as fluent/fluentd-kubernetes-daemonset images with Elasticsearch, S3, Kafka and other outputs preinstalled. Check a config before deploying it: fluentd --dry-run -c fluent.conf.

Instructions

Task 0: Run it and add plugins

FROM fluent/fluentd:v1.20-debian-1
USER root
RUN fluent-gem install fluent-plugin-elasticsearch fluent-plugin-s3 --no-document
USER fluent
docker build -t shopkeep/fluentd:1.20 .
docker run --rm -v "$PWD/fluent.conf:/fluentd/etc/fluent.conf:ro" shopkeep/fluentd:1.20 --dry-run -c /fluentd/etc/fluent.conf

Task A: Basic Fluentd Configuration

# fluent.conf — Collect application logs and forward to Elasticsearch
<source>
  @type tail
  path /var/log/app/*.log
  pos_file /var/log/fluentd/app.log.pos
  tag app.logs
  <parse>
    @type json
    time_key timestamp
    time_format %Y-%m-%dT%H:%M:%S.%NZ
  </parse>
</source>

<filter app.logs>
  @type grep
  <exclude>
    key level
    pattern /^debug$/
  </exclude>
</filter>

<match app.logs>
  @type elasticsearch
  host elasticsearch
  port 9200
  index_name fluentd-${tag}-%Y.%m.%d
  <buffer tag, time>
    @type file
    path /var/log/fluentd/buffer/es
    timekey 1h
    timekey_wait 10m
    flush_mode interval
    flush_interval 30s
    chunk_limit_size 8MB
    total_limit_size 2GB
    retry_max_interval 30
    overflow_action block
  </buffer>
</match>

flush_interval is ignored unless flush_mode interval is set: when the buffer has a time chunk key the default mode is lazy and chunks flush only after timekey plus timekey_wait. For nginx access logs use <parse> @type nginx </parse>. Add read_from_head true to a tail source when testing against an existing file; without it, only new lines are read.

Task B: Multi-Output Routing

# fluent.conf — Route logs to different destinations based on tag
<match error.**>
  @type copy
  <store>
    @type elasticsearch
    host elasticsearch
    port 9200
    index_name errors-%Y.%m.%d
    <buffer tag, time>
      timekey 1d
      flush_mode interval
      flush_interval 10s
    </buffer>
  </store>
  <store>
    @type http
    endpoint http://alert-gateway.internal:8080/alerts
    <format>
      @type json
    </format>
    <buffer>
      flush_mode interval
      flush_interval 5s
    </buffer>
  </store>
</match>

<match audit.**>
  @type s3
  # credentials come from the instance/pod role or the standard AWS_* environment variables
  s3_bucket audit-logs-production
  s3_region us-east-1
  path logs/%Y/%m/%d/
  <buffer tag, time>
    @type file
    path /var/log/fluentd/buffer/s3
    timekey 3600
    timekey_wait 10m
  </buffer>
  <format>
    @type json
  </format>
</match>

The http store posts each record as JSON to your alert gateway (built in, checked against a local listener). The fluent-plugin-slack gem crashes on startup under the Ruby 3.4 used by current images (undefined method 'unescape' for module URI), so alerts go through http instead.

Task C: Kubernetes DaemonSet Deployment

The fluent/fluentd-kubernetes-daemonset image already contains the Elasticsearch output, the Kubernetes metadata filter and the CRI parser. The metadata filter reads pod labels from the API server, so the DaemonSet needs RBAC.

# fluentd-daemonset.yml — Fluentd DaemonSet for Kubernetes log collection
apiVersion: v1
kind: ServiceAccount
metadata:
  name: fluentd
  namespace: logging
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: fluentd
rules:
  - apiGroups: [""]
    resources: ["pods", "namespaces"]
    verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: fluentd
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: fluentd
subjects:
  - kind: ServiceAccount
    name: fluentd
    namespace: logging
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: fluentd
  namespace: logging
spec:
  selector:
    matchLabels:
      app: fluentd
  template:
    metadata:
      labels:
        app: fluentd
    spec:
      serviceAccountName: fluentd
      containers:
        - name: fluentd
          image: fluent/fluentd-kubernetes-daemonset:v1.20-debian-elasticsearch8-1
          env:
            - name: FLUENT_ELASTICSEARCH_HOST
              value: "elasticsearch.logging.svc.cluster.local"
            - name: FLUENT_ELASTICSEARCH_PORT
              value: "9200"
Полный SKILL.md на GitHub

Установить fluentd в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл fluentd?

Configure Fluentd for unified log collection, routing, filtering, and forwarding across distributed systems. Use when a user needs to aggregate logs from multiple sources, transform log data with filters, route logs to different destinations, or set up Fluentd as a Kubernetes log collector.

Как установить скилл fluentd?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл fluentd запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить fluentd с