mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
fluent-bit: make functional
* make the fluent-bit functional on target with iowrt * resolve crash with file output plugin * setup init file * setup default conf file - no logging
This commit is contained in:
parent
dc650533f4
commit
4f9dae3d0e
4 changed files with 80 additions and 18 deletions
|
|
@ -1,18 +1,19 @@
|
||||||
#
|
#
|
||||||
# Copright (C) 2018 The Internet Foundation In Sweden
|
# Copyright (C) 2023 IOPSYS
|
||||||
#
|
#
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=fluentbit
|
PKG_NAME:=fluent-bit
|
||||||
PKG_VERSION:=1.0.0
|
PKG_VERSION:=3.1.0
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
LOCAL_DEV:=0
|
||||||
PKG_SOURCE_URL:=https://github.com/fluent/fluent-bit.git
|
ifneq ($(LOCAL_DEV),1)
|
||||||
PKG_SOURCE_VERSION:=v3.0.5
|
PKG_SOURCE=v$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
PKG_SOURCE_URL:=https://github.com/fluent/fluent-bit/archive/refs/tags/
|
||||||
PKG_MIRROR_HASH:=skip
|
PKG_HASH:=7a49e110cf3050b6c29c911063494b8081f3c743274d1d95e52562d0476ba1eb
|
||||||
|
endif
|
||||||
|
|
||||||
PKG_LICENSE:=Apache-2.0
|
PKG_LICENSE:=Apache-2.0
|
||||||
PKG_LICENSE_FILES:=LICENSE
|
PKG_LICENSE_FILES:=LICENSE
|
||||||
|
|
@ -20,25 +21,32 @@ PKG_LICENSE_FILES:=LICENSE
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
include $(INCLUDE_DIR)/cmake.mk
|
include $(INCLUDE_DIR)/cmake.mk
|
||||||
|
|
||||||
define Package/fluentbit
|
define Package/fluent-bit
|
||||||
CATEGORY:=Utilities
|
CATEGORY:=Utilities
|
||||||
DEPENDS:= +libyaml +libopenssl +libcurl +libatomic +musl-fts
|
DEPENDS:= +libyaml +libopenssl +libcurl +libatomic +musl-fts +flex +bison
|
||||||
TITLE:=FluentBit
|
TITLE:=Fluent-Bit
|
||||||
|
URL:=https://fluentbit.io/
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/fluentbit/description
|
define Package/fluent-bit/description
|
||||||
Fluent Bit is a super fast, lightweight, and highly scalable logging and metrics processor and forwarder.
|
Fluent Bit is a super fast, lightweight, and highly scalable logging and metrics processor and forwarder.
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
ifeq ($(LOCAL_DEV),1)
|
||||||
|
define Build/Prepare
|
||||||
|
$(CP) -rf ./fluent-bit/* $(PKG_BUILD_DIR)/
|
||||||
|
endef
|
||||||
|
endif
|
||||||
|
|
||||||
# General options
|
# General options
|
||||||
TARGET_LDFLAGS+=-lfts -latomic
|
TARGET_LDFLAGS +=-lfts -latomic
|
||||||
|
|
||||||
CMAKE_OPTIONS+= \
|
CMAKE_OPTIONS+= \
|
||||||
-DFLB_RELEASE=Yes \
|
-DFLB_RELEASE=Yes \
|
||||||
-DFLB_SMALL=Yes \
|
-DFLB_SMALL=No \
|
||||||
-DEXCLUDE_FROM_ALL=true \
|
-DEXCLUDE_FROM_ALL=true \
|
||||||
-DBUILD_SHAREDD_LIBS=Yes \
|
-DFLB_SHARED_LIBS=Yes \
|
||||||
-DFLB_DEBUG=No \
|
-DFLB_DEBUG=Yes \
|
||||||
-DFLB_ALL=No \
|
-DFLB_ALL=No \
|
||||||
-DFLB_JEMALLOC=No \
|
-DFLB_JEMALLOC=No \
|
||||||
-DFLB_EXAMPLES=No \
|
-DFLB_EXAMPLES=No \
|
||||||
|
|
@ -156,10 +164,14 @@ CMAKE_OPTIONS += \
|
||||||
-DFLB_OUT_CHRONICLE=No \
|
-DFLB_OUT_CHRONICLE=No \
|
||||||
-DFLB_OUT_PGSQL=No
|
-DFLB_OUT_PGSQL=No
|
||||||
|
|
||||||
define Package/fluentbit/install
|
define Package/fluent-bit/install
|
||||||
$(INSTALL_DIR) $(1)/etc/init.d
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
$(INSTALL_DIR) $(1)/usr/sbin
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
|
$(INSTALL_DIR) $(1)/etc/fluent-bit
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/fluent-bit $(1)/usr/sbin/
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/fluent-bit $(1)/usr/sbin/
|
||||||
|
$(INSTALL_BIN) ./files/fluent-bit.init $(1)/etc/init.d/fluent-bit
|
||||||
|
$(INSTALL_DATA) ./files/fluent-bit.conf $(1)/etc/fluent-bit/fluent-bit.conf
|
||||||
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/conf/parsers.conf $(1)/etc/fluent-bit/parsers.conf
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,fluentbit))
|
$(eval $(call BuildPackage,fluent-bit))
|
||||||
15
fluent-bit/files/fluent-bit.conf
Normal file
15
fluent-bit/files/fluent-bit.conf
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
[SERVICE]
|
||||||
|
flush 3
|
||||||
|
daemon Off
|
||||||
|
log_level info
|
||||||
|
parsers_file /etc/fluent-bit/parsers.conf
|
||||||
|
|
||||||
|
[INPUT]
|
||||||
|
name syslog
|
||||||
|
tag syslog
|
||||||
|
path /dev/log
|
||||||
|
|
||||||
|
[OUTPUT]
|
||||||
|
name null
|
||||||
|
match *
|
||||||
|
|
||||||
21
fluent-bit/files/fluent-bit.init
Normal file
21
fluent-bit/files/fluent-bit.init
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
|
START=12
|
||||||
|
STOP=89
|
||||||
|
USE_PROCD=1
|
||||||
|
|
||||||
|
PROG=/usr/sbin/fluent-bit
|
||||||
|
CONF=/etc/fluent-bit/fluent-bit.conf
|
||||||
|
|
||||||
|
. /lib/functions.sh
|
||||||
|
|
||||||
|
start_service() {
|
||||||
|
procd_open_instance
|
||||||
|
procd_set_param command $PROG -c $CONF
|
||||||
|
procd_set_param respawn
|
||||||
|
procd_close_instance
|
||||||
|
}
|
||||||
|
|
||||||
|
service_triggers() {
|
||||||
|
procd_add_reload_trigger fluent-bit
|
||||||
|
}
|
||||||
14
fluent-bit/patches/0001-fix_out_file_plugin.patch
Normal file
14
fluent-bit/patches/0001-fix_out_file_plugin.patch
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
diff --git a/plugins/out_file/file.c b/plugins/out_file/file.c
|
||||||
|
index 2e47c9666..42ace24c6 100644
|
||||||
|
--- a/plugins/out_file/file.c
|
||||||
|
+++ b/plugins/out_file/file.c
|
||||||
|
@@ -45,6 +45,9 @@
|
||||||
|
#define NEWLINE "\n"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#undef PATH_MAX
|
||||||
|
+#define PATH_MAX 256
|
||||||
|
+
|
||||||
|
struct flb_file_conf {
|
||||||
|
const char *out_path;
|
||||||
|
const char *out_file;
|
||||||
Loading…
Add table
Reference in a new issue