Skip to content

Commit

Permalink
added-kusto-specific-headers
Browse files Browse the repository at this point in the history
Signed-off-by: Tanmaya Panda <[email protected]>
(cherry picked from commit ccfc8ee)
  • Loading branch information
tanmaya-panda1 committed Jan 8, 2024
1 parent cd497e3 commit 4c06086
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions plugins/out_azure_kusto/azure_kusto_ingest.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <fluent-bit/flb_random.h>
#include <fluent-bit/flb_time.h>
#include <fluent-bit/flb_utils.h>
#include <fluent-bit/flb_version.h>

#include <math.h>
#include <msgpack.h>
Expand Down Expand Up @@ -164,6 +165,12 @@ static flb_sds_t azure_kusto_create_blob(struct flb_azure_kusto *ctx, flb_sds_t
flb_http_add_header(c, "x-ms-date", 9, tmp, len);
flb_http_add_header(c, "x-ms-version", 12, "2019-12-12", 10);

//added kusto specific headers for debugging requests
flb_http_add_header(c, "x-ms-user", 9, "Fluent-Bit", 10);
flb_http_add_header(c, "x-ms-client-request-id", 22, generate_uuid(), 36);
flb_http_add_header(c, "x-ms-client-version", 10, FLB_VERSION_STR, strlen(FLB_VERSION_STR));
flb_http_add_header(c, "x-ms-app", 8, "Kusto.Fluent-Bit", 16);

ret = flb_http_do(c, &resp_size);
flb_plg_debug(ctx->ins,
"kusto blob upload request http_do=%i, HTTP Status: %i",
Expand Down Expand Up @@ -367,6 +374,12 @@ static int azure_kusto_enqueue_ingestion(struct flb_azure_kusto *ctx, flb_sds_t
flb_http_add_header(c, "x-ms-date", 9, tmp, len);
flb_http_add_header(c, "x-ms-version", 12, "2019-12-12", 10);

//added kusto specific headers for debugging requests
flb_http_add_header(c, "x-ms-user", 9, "Fluent-Bit", 10);
flb_http_add_header(c, "x-ms-client-request-id", 22, generate_uuid(), 36);
flb_http_add_header(c, "x-ms-client-version", 10, FLB_VERSION_STR, strlen(FLB_VERSION_STR));
flb_http_add_header(c, "x-ms-app", 8, "Kusto.Fluent-Bit", 16);

ret = flb_http_do(c, &resp_size);
flb_plg_debug(ctx->ins,
"kusto queue request http_do=%i, HTTP Status: %i", ret,
Expand Down

0 comments on commit 4c06086

Please sign in to comment.