Fluent Bit 未在 CloudWatch 中创建日志流

Fluent Bit 未在 CloudWatch 中创建日志流

Fluent Bit 仅发送第一个日志流,其他日志流不发送。这是我的配置:

config:
      inputs: |
        [INPUT]
            Name                    tail
            Path                    /var/log/containers/ingress-nginx-controller*.log
            multiline.parser        docker, cri
            Tag                     kube.*
            Mem_Buf_Limit           5MB
            Skip_Long_Lines         On
        [INPUT]
            Name                    tail
            Path                    /var/log/containers/wordpress-test*.log
            exclude_path            kube.var.log.containers.wordpress-test-stage*.log
            multiline.parser        docker, cri
            Tag                     kube.*
            Mem_Buf_Limit           5MB
            Skip_Long_Lines         On
        [INPUT]
            Name                    tail
            Path                    /var/log/containers/wordpress-test-stage*.log
            multiline.parser        docker, cri
            Tag                     kube.*
            Mem_Buf_Limit           5MB
            Skip_Long_Lines         On
        [INPUT]
            Name                    tail
            Path                    /var/log/containers/mysql-stage*.log
            multiline.parser        docker, cri
            Tag                     kube.*
            Mem_Buf_Limit           5MB
            Skip_Long_Lines         On
        [INPUT]
            Name                    systemd
            Tag                     host.*
            Systemd_Filter          _SYSTEMD_UNIT=kubelet.service
            Read_From_Tail          On
      outputs: |
        [OUTPUT]
            Name                    cloudwatch_logs
            Match                   kube.var.log.containers.ingress-nginx-controller*
            region                  eu-west-1
            log_group_name          beyer-eks/nginx-access-logs
            log_stream_prefix       nginx_ingress_
            auto_create_group       true
        [OUTPUT]
            Name                    cloudwatch_logs
            Match                   kube.var.log.containers.mysql-stage*
            region                  eu-west-1
            log_group_name          beyer-eks/mysql-stage-logs
            log_stream_name         mysql_stage_
            auto_create_group       true
        [OUTPUT]
            Name                    cloudwatch_logs
            Match_Regex             kube.var.log.containers.wordpress-test(?!-stage)*
            region                  eu-west-1
            log_group_name          beyer-eks/wordpress-test-logs
            log_stream_name         wordpress_test_
            auto_create_group       true
        [OUTPUT]
            Name                    cloudwatch_logs
            Match                   kube.var.log.containers.wordpress-test-stage*
            region                  eu-west-1
            log_group_name          beyer-eks/wordpress-test-stage-logs
            log_stream_name         wordpress_test_stage_
            auto_create_group       true
        
        [SERVICE]
            Flush                   10

日志组已创建。在我的 Fluent Bit Pod 日志中,我看到输入已创建,但仅创建了一个输出流:

    [2023/09/28 08:53:12] [ info] [input:systemd:systemd.4] initializing

[2023/09/28 08:53:12] [ info] [input:systemd:systemd.4] storage_strategy='memory' (memory only)

[2023/09/28 08:53:12] [ info] [filter:kubernetes:kubernetes.0] https=1 host=kubernetes.default.svc port=443

[2023/09/28 08:53:12] [ info] [filter:kubernetes:kubernetes.0]  token updated

[2023/09/28 08:53:12] [ info] [filter:kubernetes:kubernetes.0] local POD info OK

[2023/09/28 08:53:12] [ info] [filter:kubernetes:kubernetes.0] testing connectivity with API server...

[2023/09/28 08:53:12] [ info] [filter:kubernetes:kubernetes.0] connectivity OK

[2023/09/28 08:53:13] [ info] [output:cloudwatch_logs:cloudwatch_logs.0] worker #0 started

[2023/09/28 08:53:13] [ info] [output:cloudwatch_logs:cloudwatch_logs.1] worker #0 started

[2023/09/28 08:53:13] [ info] [output:cloudwatch_logs:cloudwatch_logs.2] worker #0 started

[2023/09/28 08:53:13] [ info] [output:cloudwatch_logs:cloudwatch_logs.3] worker #0 started

[2023/09/28 08:53:13] [ info] [http_server] listen iface=0.0.0.0 tcp_port=2020

[2023/09/28 08:53:13] [ info] [sp] stream processor started

[2023/09/28 08:53:13] [ info] [input:tail:tail.0] inotify_fs_add(): inode=35869902 watch_fd=1 name=/var/log/containers/ingress-nginx-controller-6mwh4_nginx_controller-219138eb00d91b5c75ad82ac20cbc2c958817631754abb43a46d9501b14dd71f.log

[2023/09/28 08:53:13] [ info] [input:tail:tail.0] inotify_fs_add(): inode=35863845 watch_fd=2 name=/var/log/containers/ingress-nginx-controller-6mwh4_nginx_controller-2b8a80aee75890170c1d97e49da3a01d6a62c957b297669096b3a64fa7d025f7.log

[2023/09/28 08:53:13] [ info] [input:tail:tail.1] inotify_fs_add(): inode=38945883 watch_fd=1 name=/var/log/containers/wordpress-test-65df4bc7c6-z99l7_wordpress-test_wordpress-test-834b7f6f99376ed16dd8ce67b69fabe9172b34f1f240fccf21816c4cdbc18184.log

[2023/09/28 08:53:13] [ info] [input:tail:tail.1] inotify_fs_add(): inode=35871184 watch_fd=2 name=/var/log/containers/wordpress-test-stage-9784c7b7d-c9b8m_wordpress-test-stage_wordpress-test-stage-ba3f3f6c5291b2560a24f78b9260544cc2ea4f7414d5a7d3e1089dba3ba6ef60.log

[2023/09/28 08:53:13] [ info] [input:tail:tail.2] inotify_fs_add(): inode=35871184 watch_fd=1 name=/var/log/containers/wordpress-test-stage-9784c7b7d-c9b8m_wordpress-test-stage_wordpress-test-stage-ba3f3f6c5291b2560a24f78b9260544cc2ea4f7414d5a7d3e1089dba3ba6ef60.log

[2023/09/28 08:53:13] [ info] [input:tail:tail.3] inotify_fs_add(): inode=36822179 watch_fd=1 name=/var/log/containers/mysql-stage-588bd7d59b-j684v_wordpress-test-stage_mysql-stage-61a71098fc502a8d5940675134d985fc866987168ef7c3caa2e763dd48e6a36d.log

[2023/09/28 08:53:13] [ info] [input:tail:tail.3] inotify_fs_add(): inode=36822181 watch_fd=2 name=/var/log/containers/mysql-stage-588bd7d59b-j684v_wordpress-test-stage_mysql-stage-d56042a198c316aec7871a4e4dffb4d224471828b62ba9843806aa168712a975.log

[2023/09/28 08:53:23] [ info] [output:cloudwatch_logs:cloudwatch_logs.0] Creating log stream nginx_ingress_kube.var.log.containers.ingress-nginx-controller-6mwh4_nginx_controller-219138eb00d91b5c75ad82ac20cbc2c958817631754abb43a46d9501b14dd71f.log in log group beyer-eks/nginx-access-logs

[2023/09/28 08:53:23] [ info] [output:cloudwatch_logs:cloudwatch_logs.0] Log Stream nginx_ingress_kube.var.log.containers.ingress-nginx-controller-6mwh4_nginx_controller-219138eb00d91b5c75ad82ac20cbc2c958817631754abb43a46d9501b14dd71f.log already exists

我这里遗漏了什么吗?

我已经尝试使用简单的流名称并改变输出流的顺序。

相关内容