Skip to content

Commit

Permalink
config: support sp.convert_from_str_to_num
Browse files Browse the repository at this point in the history
Signed-off-by: Takahiro Yamashita <[email protected]>
  • Loading branch information
nokute78 authored and edsiper committed Sep 23, 2023
1 parent 63f1578 commit 1b2306a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/fluent-bit/flb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ struct flb_config {
#ifdef FLB_HAVE_STREAM_PROCESSOR
char *stream_processor_file; /* SP configuration file */
void *stream_processor_ctx; /* SP context */
int stream_processor_str_conv; /* SP enable converting from string to number */

/*
* Temporal list to hold tasks defined before the SP context is created
Expand Down Expand Up @@ -322,6 +323,7 @@ enum conf_type {
#define FLB_CONF_STR_PARSERS_FILE "Parsers_File"
#define FLB_CONF_STR_PLUGINS_FILE "Plugins_File"
#define FLB_CONF_STR_STREAMS_FILE "Streams_File"
#define FLB_CONF_STR_STREAMS_STR_CONV "sp.convert_from_str_to_num"
#define FLB_CONF_STR_CONV_NAN "json.convert_nan_to_null"

/* FLB_HAVE_HTTP_SERVER */
Expand Down
4 changes: 4 additions & 0 deletions src/flb_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ struct flb_service_config service_configs[] = {
{FLB_CONF_STR_STREAMS_FILE,
FLB_CONF_TYPE_STR,
offsetof(struct flb_config, stream_processor_file)},
{FLB_CONF_STR_STREAMS_STR_CONV,
FLB_CONF_TYPE_BOOL,
offsetof(struct flb_config, stream_processor_str_conv)},
#endif

#ifdef FLB_HAVE_CHUNK_TRACE
Expand Down Expand Up @@ -289,6 +292,7 @@ struct flb_config *flb_config_init()

#ifdef FLB_HAVE_STREAM_PROCESSOR
flb_slist_create(&config->stream_processor_tasks);
config->stream_processor_str_conv = FLB_TRUE;
#endif

flb_slist_create(&config->external_plugins);
Expand Down

0 comments on commit 1b2306a

Please sign in to comment.