feat: support the Fluent Bit type_converter filter

Đang mở
#2,131 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@NopeCharon đang làm issue này rồi.

Từ ngày 12/11/2026.

  • #2132 của @NopeCharon — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
65/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go, kubernetes
Lĩnh vực
backend, devops

Hướng nghiên cứu

Start with apis/fluentbit/v1alpha2/clusterfilter_types.go and trace how existing filter fields are rendered into Fluent Bit config and YAML. Add the typeConverter API shape and validation for its four source lists, keys, supported types, and nonempty rules; follow the corresponding rendering and CRD tests. Done means both ClusterFilter and namespaced Filter accept valid conversions, reject invalid ones, and render the requested formats.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Is your feature request related to a problem? Please describe.

Fluent Bit's type_converter filter converts a field to another type (int, uint, float or string) and appends the result under a new key. It's the usual way to get a number into a string so grep or modify can match on it, or to turn a numeric string into a real number before it reaches a metrics or search backend.

FilterItem in apis/fluentbit/v1alpha2/clusterfilter_types.go has no field for it, so neither a ClusterFilter nor a namespaced Filter can use it. The only workaround is customPlugin, which means writing the config by hand, and the API server can't check it. A typo there only shows up when Fluent Bit fails to start.

Describe the solution you'd like

Add a typeConverter filter with one list for each source type that Fluent Bit supports (int_key, uint_key, float_key, str_key). Each entry has a fromKey, a toKey and a target type:

apiVersion: fluentbit.fluent.io/v1alpha2
kind: ClusterFilter
metadata:
  name: type-converter
spec:
  match: "*"
  filters:
    - typeConverter:
        strKeys:
          - fromKey: status
            toKey: status_code
            type: int

This renders as Str_Key status status_code int, and as a list in the YAML config format.

Fluent Bit takes exactly three space-separated tokens per entry, and it won't start if the filter has no rules ([filter:type_converter] no rules). So the CRD should reject keys that contain whitespace, types other than the four supported ones, and a typeConverter with no conversions.

Additional context

The plugin is part of the upstream fluent/fluent-bit image the operator's Fluent Bit image is built from.

Ngôn ngữ chính
Go
Star
689
Fork
333
Merge trung bình
2 ngày 6 giờ
Pull request đã merge (30 ngày)
43

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fluent/fluent-operator

Tất cả issue của fluent/fluent-operator

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.