Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: complete Yaml support #9513

Merged
merged 26 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a9b3a12
parser: allow to register parser with flb_cf context
edsiper Oct 22, 2024
14b2ded
config: allow parsers and multiline parsers in main config file for Yaml
edsiper Oct 22, 2024
2200217
config_format: cf_yaml: add support for 'parsers' section
edsiper Oct 22, 2024
eb116bb
config_format: cf_yaml: move back properties print to debug mode
edsiper Oct 22, 2024
c24d47e
config: load multiline parsers definitions from config format
edsiper Oct 24, 2024
fbd86aa
parser: split logic to handle multiline rules
edsiper Oct 24, 2024
4bb67b2
config_format: cf_yaml: add support for multiline_parsers
edsiper Oct 24, 2024
4fbcfde
tests: internal: config_format: yaml: add parsers and multiline parsers
edsiper Oct 24, 2024
b481695
config_format: yaml: register stream_processor section
edsiper Oct 24, 2024
2109bcd
config_format: add handlers for new stream_processor section
edsiper Oct 24, 2024
6a3df4c
config_format: yaml: add support to parse stream_processor section
edsiper Oct 24, 2024
35c9e4b
sp: allow to read new sections set by Yaml
edsiper Oct 24, 2024
f3520c0
tests: internal: config_format: yaml: add unit tests for stream_proce…
edsiper Oct 24, 2024
6d1a8a3
config_format: register plugins as sections
edsiper Oct 24, 2024
e434d30
plugin: allow to load plugins by using config_format context
edsiper Oct 24, 2024
e9cc39e
config: load plugins if they are part of the main context
edsiper Oct 24, 2024
2b93767
config_format: yaml: add support to parse 'plugins' section
edsiper Oct 24, 2024
8328ed7
tests: internal: config_format: yaml: add unit tests for plugins
edsiper Oct 24, 2024
0a15368
sp: validate config_format context before iterate
edsiper Oct 24, 2024
f4946fe
plugin: allow plugins_file to support Yaml
edsiper Oct 24, 2024
2381a1f
config_format: register section upstream_servers
edsiper Oct 25, 2024
714cc57
config_format: yaml: add support for upstream_servers
edsiper Oct 25, 2024
c6c8207
upstream_ha: extend to read upstream servers configured by Yaml
edsiper Oct 25, 2024
eda97c5
tests: internal: config_format: yaml: add tests for upstream_servers
edsiper Oct 25, 2024
7dcf1f2
tests: internal: config_format: yaml: fix path for WIN32
edsiper Oct 26, 2024
ca31f51
upstream_ha: check if Yaml is available
edsiper Oct 26, 2024
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
16 changes: 14 additions & 2 deletions include/fluent-bit/config_format/flb_cf.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ enum cf_file_format {
enum section_type {
FLB_CF_SERVICE = 0, /* [SERVICE] */
FLB_CF_PARSER, /* [PARSER] */
FLB_CF_MULTILINE_PARSER, /* [MULTILINE_PARSER] */
FLB_CF_MULTILINE_PARSER, /* multiline_parser */
FLB_CF_STREAM_PROCESSOR, /* stream_processor */
FLB_CF_PLUGINS, /* plugins */
FLB_CF_UPSTREAM_SERVERS, /* upstream_servers */
FLB_CF_CUSTOM, /* [CUSTOM] */
FLB_CF_INPUT, /* [INPUT] */
FLB_CF_FILTER, /* [FILTER] */
Expand Down Expand Up @@ -97,7 +100,16 @@ struct flb_cf {
struct mk_list parsers;
struct mk_list multiline_parsers;

/* custom plugins */
/* stream processor: every entry is added as a task */
struct mk_list stream_processors;

/* external plugins (.so) */
struct mk_list plugins;

/* upstream servers */
struct mk_list upstream_servers;

/* 'custom' type plugins */
struct mk_list customs;

/* pipeline */
Expand Down
7 changes: 6 additions & 1 deletion include/fluent-bit/flb_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ enum {
FLB_PARSER_TYPE_HEX,
};

static inline time_t flb_parser_tm2time(const struct flb_tm *src,
static inline time_t flb_parser_tm2time(const struct flb_tm *src,
int use_system_timezone)
{
struct tm tmp;
Expand Down Expand Up @@ -107,6 +107,11 @@ struct flb_parser *flb_parser_create(const char *name, const char *format,
struct flb_config *config);
int flb_parser_conf_file_stat(const char *file, struct flb_config *config);
int flb_parser_conf_file(const char *file, struct flb_config *config);
int flb_parser_load_parser_definitions(const char *cfg, struct flb_cf *cf,
struct flb_config *config);
int flb_parser_load_multiline_parser_definitions(const char *cfg, struct flb_cf *cf,
struct flb_config *config);

void flb_parser_destroy(struct flb_parser *parser);
struct flb_parser *flb_parser_get(const char *name, struct flb_config *config);
int flb_parser_do(struct flb_parser *parser, const char *buf, size_t length,
Expand Down
4 changes: 4 additions & 0 deletions include/fluent-bit/flb_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ struct flb_plugins {
struct flb_plugins *flb_plugin_create();
int flb_plugin_load(char *path, struct flb_plugins *ctx,
struct flb_config *config);

int flb_plugin_load_router(char *path, struct flb_config *config);

int flb_plugin_load_config_file(const char *file, struct flb_config *config);
int flb_plugin_load_config_format(struct flb_cf *cf, struct flb_config *config);

void flb_plugin_destroy(struct flb_plugins *ctx);

#endif
Loading
Loading