Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions cmake/plugins_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ DEFINE_OPTION(FLB_OUT_DATADOG "Enable DataDog output plugin"
DEFINE_OPTION(FLB_OUT_ES "Enable Elasticsearch output plugin" ON)
DEFINE_OPTION(FLB_OUT_EXIT "Enable Exit output plugin" ON)
DEFINE_OPTION(FLB_OUT_FILE "Enable file output plugin" ON)
DEFINE_OPTION(FLB_OUT_LOGROTATE "Enable logrotate output plugin" ON)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this build for all targets including macOS and Windows? They may need configuring via their specific cmake/ config files.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the logrotate plugin is actually a fork of the out_file with gzip and couple of move/copy files.
I've matched all cmakes to be the same as the out_file

DEFINE_OPTION(FLB_OUT_FLOWCOUNTER "Enable flowcount output plugin" ON)
DEFINE_OPTION(FLB_OUT_FORWARD "Enable Forward output plugin" ON)
DEFINE_OPTION(FLB_OUT_GELF "Enable GELF output plugin" ON)
Expand Down
21 changes: 21 additions & 0 deletions conf/fluent-bit-logrotate.conf
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should provide a YAML version too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I didn't see other configs. let me know where can I put it. anyway in fluent-bit-docs I'll list both options

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[SERVICE]
Flush 1
Log_Level info
Parsers_File parsers.conf

[INPUT]
Name dummy
Tag test.logrotate
Dummy {"message": "test log message", "level": "info"}
Rate 10

[OUTPUT]
Name logrotate
Match test.logrotate
Path /tmp/logs
File test.log
Format json
Max_Size 10M
Max_Files 5
Gzip On
Mkdir On
5 changes: 5 additions & 0 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,11 @@ REGISTER_OUT_PLUGIN("out_datadog")
REGISTER_OUT_PLUGIN("out_es")
REGISTER_OUT_PLUGIN("out_exit")
REGISTER_OUT_PLUGIN("out_file")

if(FLB_OUT_LOGROTATE)
REGISTER_OUT_PLUGIN("out_logrotate")
endif()

REGISTER_OUT_PLUGIN("out_forward")
REGISTER_OUT_PLUGIN("out_http")
REGISTER_OUT_PLUGIN("out_influxdb")
Expand Down
5 changes: 5 additions & 0 deletions plugins/out_logrotate/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(src
logrotate.c)

find_package(ZLIB REQUIRED)
FLB_PLUGIN(out_logrotate "${src}" "${ZLIB_LIBRARIES}")
Loading
Loading