From b348f436e668e272530fab724c11f1a8832db86b Mon Sep 17 00:00:00 2001 From: kev Date: Sat, 6 May 2023 16:41:05 +0800 Subject: [PATCH] add fluent-bit --- README.md | 1 + fluent-bit/README.md | 18 ++++ fluent-bit/data/etc/fluent-bit.conf | 93 ++++++++++++++++++++ fluent-bit/data/etc/parsers.conf | 126 ++++++++++++++++++++++++++++ fluent-bit/data/etc/plugins.conf | 2 + fluent-bit/data/var/.gitkeep | 0 fluent-bit/docker-compose.yml | 10 +++ 7 files changed, 250 insertions(+) create mode 100644 fluent-bit/README.md create mode 100644 fluent-bit/data/etc/fluent-bit.conf create mode 100644 fluent-bit/data/etc/parsers.conf create mode 100644 fluent-bit/data/etc/plugins.conf create mode 100644 fluent-bit/data/var/.gitkeep create mode 100644 fluent-bit/docker-compose.yml diff --git a/README.md b/README.md index b52173d..172b565 100644 --- a/README.md +++ b/README.md @@ -347,6 +347,7 @@ A collection of delicious docker recipes. - [x] audreyt/ethercalc - [x] flogo/flogo-docker - [x] mher/flower +- [x] fluent/fluent-bit - [x] friendica - [x] ghost - [x] gitlab/gitlab-ce diff --git a/fluent-bit/README.md b/fluent-bit/README.md new file mode 100644 index 0000000..21f7cd6 --- /dev/null +++ b/fluent-bit/README.md @@ -0,0 +1,18 @@ +fluent-bit +========== + +[Fluent Bit][1] is a fast Log Processor and Forwarder for Linux, Windows, Embedded +Linux, MacOS and BSD family operating systems. It's part of the Graduated +Fluentd Ecosystem and a CNCF sub-project. + + +```bash +$ mkdir -p data/{etc,var} +$ wget -P data/etc https://github.com/fluent/fluent-bit/raw/master/conf/fluent-bit.conf \ + https://github.com/fluent/fluent-bit/raw/master/conf/parsers.conf \ + https://github.com/fluent/fluent-bit/raw/master/conf/plugins.conf +$ docker-compose up -d +$ docker-compose logs --tail 10 -f +``` + +[1]: https://github.com/fluent/fluent-bit diff --git a/fluent-bit/data/etc/fluent-bit.conf b/fluent-bit/data/etc/fluent-bit.conf new file mode 100644 index 0000000..9182107 --- /dev/null +++ b/fluent-bit/data/etc/fluent-bit.conf @@ -0,0 +1,93 @@ +[SERVICE] + # Flush + # ===== + # set an interval of seconds before to flush records to a destination + flush 1 + + # Daemon + # ====== + # instruct Fluent Bit to run in foreground or background mode. + daemon Off + + # Log_Level + # ========= + # Set the verbosity level of the service, values can be: + # + # - error + # - warning + # - info + # - debug + # - trace + # + # by default 'info' is set, that means it includes 'error' and 'warning'. + log_level info + + # Parsers File + # ============ + # specify an optional 'Parsers' configuration file + parsers_file parsers.conf + + # Plugins File + # ============ + # specify an optional 'Plugins' configuration file to load external plugins. + plugins_file plugins.conf + + # HTTP Server + # =========== + # Enable/Disable the built-in HTTP Server for metrics + http_server On + http_listen 0.0.0.0 + http_port 2020 + + # Storage + # ======= + # Fluent Bit can use memory and filesystem buffering based mechanisms + # + # - https://docs.fluentbit.io/manual/administration/buffering-and-storage + # + # storage metrics + # --------------- + # publish storage pipeline metrics in '/api/v1/storage'. The metrics are + # exported only if the 'http_server' option is enabled. + # + storage.metrics on + + # storage.path + # ------------ + # absolute file system path to store filesystem data buffers (chunks). + # + storage.path /fluent-bit/var + + # storage.sync + # ------------ + # configure the synchronization mode used to store the data into the + # filesystem. It can take the values normal or full. + # + # storage.sync normal + + # storage.checksum + # ---------------- + # enable the data integrity check when writing and reading data from the + # filesystem. The storage layer uses the CRC32 algorithm. + # + # storage.checksum off + + # storage.backlog.mem_limit + # ------------------------- + # if storage.path is set, Fluent Bit will look for data chunks that were + # not delivered and are still in the storage layer, these are called + # backlog data. This option configure a hint of maximum value of memory + # to use when processing these records. + # + # storage.backlog.mem_limit 5M + +[INPUT] + name cpu + tag cpu.local + + # Read interval (sec) Default: 1 + interval_sec 1 + +[OUTPUT] + name stdout + match * diff --git a/fluent-bit/data/etc/parsers.conf b/fluent-bit/data/etc/parsers.conf new file mode 100644 index 0000000..7170654 --- /dev/null +++ b/fluent-bit/data/etc/parsers.conf @@ -0,0 +1,126 @@ +[PARSER] + Name apache + Format regex + Regex ^(?[^ ]*) [^ ]* (?[^ ]*) \[(?