Fluent Bit 中文文档
  • Fluent Bit 中文文档
  • 关于
    • Fluent Bit 是什么?
    • Fluent Bit 简要历史
    • Fluentd & Fluent Bit
    • 协议
  • 概念
    • 核心概念
    • 缓冲
    • 数据管道
      • 输入
      • 解析器
      • 过滤器
      • 缓冲
      • 路由
      • 输出
  • 安装
    • 升级说明
    • 平台支持
    • 依赖
    • 源码安装
      • 下载源码
      • 构建和安装
      • 以静态配置构建
    • Linux 软件包
      • Amazon Linux
      • Redhat / CentOS
      • Debian
      • Ubuntu
      • 树莓派
    • Docker
    • Kubernetes
    • Windows
  • 管理
    • 配置 Fluent Bit
      • 格式与模式
      • 配置文件
      • 变量
      • 命令
      • 上游服务负载均衡
      • 单位
    • 安全性
    • 缓冲与存储
    • 积压
    • 调度与重试
    • 内存管理
    • 监控
    • 内部状态导出/信号
  • 数据管道
    • 输入插件
      • Dummy
      • Memory Metics
      • Standard Input
      • Systemd
      • tail
    • 解析器
      • JSON
      • Regular Expression
      • LTSV
      • Logfmt
    • 过滤器
      • Grep
      • Kubernetes
      • Rewrite Tag
      • Modify
      • Nest
    • 输出插件
      • Counter
      • Elasticsearch
      • File
      • FlowCounter
      • HTTP
      • Kafka
      • NULL
      • PostgreSQL
      • Standard Output
      • TCP & TLS
  • 流处理
    • 简介
    • 总览
    • 快速开始
      • Fluent Bit + SQL
      • Check Keys and NULL values
      • Hands On! 101
  • FLUENT BIT FOR DEVELOPERS
    • C Library API
    • 手动提取记录
    • Golang 输出插件
Powered by GitBook
On this page
  • @INCLUDE 命令
  • inputs.conf
  • outputs.conf
  • @SET 命令

Was this helpful?

  1. 管理
  2. 配置 Fluent Bit

命令

配置文件必须足够灵活以适应任何部署需求,它们必须保持干净且易读的格式。

Fluent Bit Commands 扩展了具有特定内置功能的配置文件。从Fluent Bit 0.12 系列开始可用的命令列表为:

命令

模版

描述

@INCLUDE FILE

包含一个配置文件

@SET KEY=VAL

配置配置变量

@INCLUDE 命令

配置日志记录管道可能会有大量配置文件。为了保持易于理解的配置,建议将配置分成多个文件。

@INCLUDE 命令允许配置读取器包含一个外部配置文件,例如:

[SERVICE]
    Flush 1

@INCLUDE inputs.conf
@INCLUDE outputs.conf

上面的示例定义了主服务配置文件,还包括两个文件以延续配置:

inputs.conf

[INPUT]
    Name cpu
    Tag  mycpu

[INPUT]
    Name tail
    Path /var/log/*.log
    Tag  varlog.*

outputs.conf

[OUTPUT]
    Name   stdout
    Match  mycpu

[OUTPUT]
    Name            es
    Match           varlog.*
    Host            127.0.0.1
    Port            9200
    Logstash_Format On

请注意,不管包含的顺序如何,Fluent Bit 始终遵循以下顺序:

  • Service

  • Inputs

  • Filters

  • Outputs

@SET 命令

@SET 命令只能在每行的根目录级别使用,这意味着它不能在配置段内使用,例如:

@SET my_input=cpu
@SET my_output=stdout

[SERVICE]
    Flush 1

[INPUT]
    Name ${my_input}

[OUTPUT]
    Name ${my_output}
Previous变量Next上游服务负载均衡

Last updated 4 years ago

Was this helpful?

Fluent Bit 支持,向 Fluent Bit 设置变量的一种方法是通过设置 Shell 环境变量,另一种是通过 @SET 命令

配置变量
@INCLUDE
@SET