Skip to content

out_s3: add Blob handling support (rebase of #9907) #10675

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

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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: 5 additions & 1 deletion include/fluent-bit/flb_aws_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,14 @@ int flb_aws_is_auth_error(char *payload, size_t payload_size);

int flb_read_file(const char *path, char **out_buf, size_t *out_size);

//* Constructs S3 object key as per the format. */
/* Constructs S3 object key as per the format. */
flb_sds_t flb_get_s3_key(const char *format, time_t time, const char *tag,
char *tag_delimiter, uint64_t seq_index);

/* Constructs S3 object key as per the blob format. */
flb_sds_t flb_get_s3_blob_key(const char *format, const char *tag,
char *tag_delimiter, const char *blob_path);

/*
* This function is an extension to strftime which can support milliseconds with %3N,
* support nanoseconds with %9N or %L. The return value is the length of formatted
Expand Down
451 changes: 451 additions & 0 deletions include/fluent-bit/flb_blob_db.h

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions include/fluent-bit/flb_sqldb.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <sqlite3.h>
#include <fluent-bit.h>
#include <fluent-bit/flb_lock.h>

struct flb_sqldb {
char *path; /* physical path of the database */
Expand All @@ -30,6 +31,7 @@ struct flb_sqldb {
int users; /* number of active users */
void *parent; /* if shared, ref to parent */
sqlite3 *handler; /* SQLite3 handler */
flb_lock_t lock; /* thread safety mechanism */
struct mk_list _head; /* Link to config->sqldb_list */
};

Expand All @@ -40,6 +42,11 @@ int flb_sqldb_close(struct flb_sqldb *db);
int flb_sqldb_query(struct flb_sqldb *db, const char *sql,
int (*callback) (void *, int, char **, char **),
void *data);

int64_t flb_sqldb_last_id(struct flb_sqldb *db);

int flb_sqldb_lock(struct flb_sqldb *db);

int flb_sqldb_unlock(struct flb_sqldb *db);

#endif
2 changes: 1 addition & 1 deletion plugins/in_blob/blob_db.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/* Fluent Bit
* ==========
* Copyright (C) 2015-2024 The Fluent Bit Authors
* Copyright (C) 2015-2025 The Fluent Bit Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Loading
Loading