Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,12 @@ if(FLB_OUT_PGSQL AND (NOT PostgreSQL_FOUND))
FLB_OPTION(FLB_OUT_PGSQL OFF)
endif()

# Zerobus FFI
# ===========
if(FLB_OUT_ZEROBUS)
include(cmake/zerobus-ffi.cmake)
endif()

# Arrow GLib
# ==========
find_package(PkgConfig)
Expand Down
1 change: 1 addition & 0 deletions cmake/plugins_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,4 @@ DEFINE_OPTION(FLB_OUT_TCP "Enable TCP output plugin"
DEFINE_OPTION(FLB_OUT_UDP "Enable UDP output plugin" ON)
DEFINE_OPTION(FLB_OUT_VIVO_EXPORTER "Enable Vivo exporter output plugin" ON)
DEFINE_OPTION(FLB_OUT_WEBSOCKET "Enable Websocket output plugin" ON)
DEFINE_OPTION(FLB_OUT_ZEROBUS "Enable Databricks Zerobus output plugin" OFF)
36 changes: 36 additions & 0 deletions cmake/zerobus-ffi.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Locate the pre-installed Zerobus FFI static library.
#
# The out_zerobus plugin requires the Zerobus FFI library to be installed
# on the build system before configuring. Fluent Bit does not download
# third-party dependencies at configure/build time.
#
# If the plugin is enabled and the library is not found, configuration fails.
#
# Use -DZEROBUS_LIB_DIR=/path/to/dir to point to a custom location.
#
# After this module runs successfully:
# ZEROBUS_LIB_FILE — full path to the static library

set(_ZEROBUS_LIB_NAME "zerobus_ffi")

if(ZEROBUS_LIB_DIR)
# User provided an explicit directory — search only there.
find_library(ZEROBUS_LIB_FILE
NAMES ${_ZEROBUS_LIB_NAME}
PATHS "${ZEROBUS_LIB_DIR}"
NO_DEFAULT_PATH
NO_CMAKE_FIND_ROOT_PATH
)
else()
# Search standard system paths.
find_library(ZEROBUS_LIB_FILE NAMES ${_ZEROBUS_LIB_NAME})
endif()

if(ZEROBUS_LIB_FILE)
message(STATUS "Zerobus FFI library: ${ZEROBUS_LIB_FILE}")
else()
message(FATAL_ERROR
"Zerobus FFI library not found. Install libzerobus_ffi or set "
"-DZEROBUS_LIB_DIR=/path/to/lib, or disable the plugin with "
"-DFLB_OUT_ZEROBUS=OFF.")
endif()
1 change: 1 addition & 0 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ REGISTER_OUT_PLUGIN("out_prometheus_remote_write")
REGISTER_OUT_PLUGIN("out_s3")
REGISTER_OUT_PLUGIN("out_vivo_exporter")
REGISTER_OUT_PLUGIN("out_chronicle")
REGISTER_OUT_PLUGIN("out_zerobus")

if(FLB_ZIG)
REGISTER_OUT_PLUGIN("out_zig_demo" "zig")
Expand Down
19 changes: 19 additions & 0 deletions plugins/out_zerobus/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
set(src
zerobus.c)

FLB_PLUGIN(out_zerobus "${src}" "")
target_link_libraries(flb-plugin-out_zerobus "${ZEROBUS_LIB_FILE}")

# Platform-specific linker flags required by the Rust FFI static library
if(WIN32)
target_link_libraries(flb-plugin-out_zerobus
ws2_32 ntdll userenv advapi32 bcrypt)
elseif(APPLE)
target_link_libraries(flb-plugin-out_zerobus
"-framework CoreFoundation"
"-framework Security"
-liconv)
elseif(UNIX)
target_link_libraries(flb-plugin-out_zerobus
-ldl -lpthread -lm -lresolv -lgcc_s)
endif()
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Loading