-
Notifications
You must be signed in to change notification settings - Fork 1.7k
out_azure_blob: add log_key option #9791
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
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Stephen Lee <[email protected]> Signed-off-by: Thomas Wilk <[email protected]>
@edsiper Can you please give us an update? |
if (val_buf == NULL) { | ||
flb_plg_error(ctx->ins, "Could not allocate enough " | ||
"memory to read record"); | ||
flb_errno(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flb_errno() needs to be called before flb_plg_error()
} | ||
|
||
|
||
while (!alloc_error && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems this variable is not being used or set
@@ -51,6 +51,160 @@ struct worker_info { | |||
|
|||
FLB_TLS_DEFINE(struct worker_info, worker_info); | |||
|
|||
static flb_sds_t cb_azb_msgpack_extract_log_key(void *out_context, const char *data, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function instead of iterate all the maps manually, instead it can use the record accessor api to access the desired field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edsiper I am not sure I follow your comment. Can you point me to the record accessor API to use instead? I am not familiar with this code base. Thanks!
This PR is based on PR #3668 but addresses Azure blob storage. The azure_blob plugin was modify to accept 'log_key' option. By default the entire log record is sent to storage. When 'log_key' option is specified in the output plugin configuration, then only the value of the key is sent to the storage blob.
Addresses #9721
Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
Documentation
Doc PR fluent/fluent-bit-docs#1540
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.
By default the entire record is sent to azure blob storage. Here is an example of a sample configuration and default output
Configuration
Record without log_key
{"@timestamp":"2025-01-02T16:56:02.906357Z","name":"Fluent Bit","year":2020}
if the 'log_key' is specified then only the specific key value is sent to azure blob storage
Sample configuration with log_key
Record with log_key set to name
Fluent Bit
Example Valgrind output
Addresses #9721