1818 * limitations under the License.
1919 */
2020
21+ #include <fluent-bit.h>
22+
2123#include <fluent-bit/flb_info.h>
2224#include <fluent-bit/flb_log.h>
2325#include <fluent-bit/flb_input.h>
@@ -54,7 +56,9 @@ struct flb_tail_config *flb_tail_config_create(struct flb_input_instance *i_ins,
5456 ctx -> i_ins = i_ins ;
5557 ctx -> ignore_older = 0 ;
5658 ctx -> skip_long_lines = FLB_FALSE ;
59+ #ifdef FLB_HAVE_SQLDB
5760 ctx -> db_sync = -1 ;
61+ #endif
5862
5963 /* Create the channel manager */
6064 ret = flb_pipe_create (ctx -> ch_manager );
@@ -260,7 +264,9 @@ struct flb_tail_config *flb_tail_config_create(struct flb_input_instance *i_ins,
260264 mk_list_init (& ctx -> files_static );
261265 mk_list_init (& ctx -> files_event );
262266 mk_list_init (& ctx -> files_rotated );
267+ #ifdef FLB_HAVE_SQLDB
263268 ctx -> db = NULL ;
269+ #endif
264270
265271#ifdef FLB_HAVE_REGEX
266272 tmp = flb_input_get_property ("tag_regex" , i_ins );
@@ -284,6 +290,7 @@ struct flb_tail_config *flb_tail_config_create(struct flb_input_instance *i_ins,
284290 ctx -> dynamic_tag = FLB_TRUE ;
285291 }
286292
293+ #ifdef FLB_HAVE_SQLDB
287294 /* Database options (needs to be set before the context) */
288295 tmp = flb_input_get_property ("db.sync" , i_ins );
289296 if (tmp ) {
@@ -312,6 +319,7 @@ struct flb_tail_config *flb_tail_config_create(struct flb_input_instance *i_ins,
312319 flb_error ("[in_tail] could not open/create database" );
313320 }
314321 }
322+ #endif
315323
316324#ifdef FLB_HAVE_METRICS
317325 flb_metrics_add (FLB_TAIL_METRIC_F_OPENED ,
@@ -344,9 +352,11 @@ int flb_tail_config_destroy(struct flb_tail_config *config)
344352 }
345353#endif
346354
355+ #ifdef FLB_HAVE_SQLDB
347356 if (config -> db != NULL ) {
348357 flb_tail_db_close (config -> db );
349358 }
359+ #endif
350360
351361 if (config -> key != NULL ) {
352362 flb_free (config -> key );
0 commit comments