From 4c060863f07aeaf6d2142c84b8232d60949d700f Mon Sep 17 00:00:00 2001 From: Tanmaya Panda Date: Tue, 17 Oct 2023 02:31:02 +0530 Subject: [PATCH 1/4] added-kusto-specific-headers Signed-off-by: Tanmaya Panda (cherry picked from commit ccfc8ee8bb261107b14c442b8687966ede4fd1bd) --- plugins/out_azure_kusto/azure_kusto_ingest.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/out_azure_kusto/azure_kusto_ingest.c b/plugins/out_azure_kusto/azure_kusto_ingest.c index 41c37308dc1..bfc27941e32 100644 --- a/plugins/out_azure_kusto/azure_kusto_ingest.c +++ b/plugins/out_azure_kusto/azure_kusto_ingest.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -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", @@ -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, From e1d2055357236d1362462324716d0817710a3fc8 Mon Sep 17 00:00:00 2001 From: Tanmaya Panda Date: Thu, 11 Jan 2024 10:31:04 +0530 Subject: [PATCH 2/4] changes code comment style Signed-off-by: Tanmaya Panda --- plugins/out_azure_kusto/azure_kusto_ingest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/out_azure_kusto/azure_kusto_ingest.c b/plugins/out_azure_kusto/azure_kusto_ingest.c index bfc27941e32..a5dedf2f8e1 100644 --- a/plugins/out_azure_kusto/azure_kusto_ingest.c +++ b/plugins/out_azure_kusto/azure_kusto_ingest.c @@ -165,7 +165,7 @@ 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 + /* 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)); @@ -374,7 +374,7 @@ 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 + /* 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)); From c080b8d6786e319bc9b93d6fe8854f9ac5321485 Mon Sep 17 00:00:00 2001 From: Tanmaya Panda Date: Mon, 12 Feb 2024 16:49:34 +0530 Subject: [PATCH 3/4] modified x-ms-user header Signed-off-by: Tanmaya Panda --- plugins/out_azure_kusto/azure_kusto.c | 8 ++++++++ plugins/out_azure_kusto/azure_kusto_ingest.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/out_azure_kusto/azure_kusto.c b/plugins/out_azure_kusto/azure_kusto.c index 58ac559dbdc..0b6a23e8b1d 100644 --- a/plugins/out_azure_kusto/azure_kusto.c +++ b/plugins/out_azure_kusto/azure_kusto.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "azure_kusto.h" #include "azure_kusto_conf.h" @@ -152,6 +153,13 @@ flb_sds_t execute_ingest_csl_command(struct flb_azure_kusto *ctx, const char *cs flb_http_add_header(c, "Accept", 6, "application/json", 16); flb_http_add_header(c, "Authorization", 13, token, flb_sds_len(token)); + + /* added kusto specific headers for debugging requests */ + flb_http_add_header(c, "x-ms-user", 9, "Kusto.Fluent-Bit", 16); + 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); + flb_http_buffer_size(c, FLB_HTTP_DATA_SIZE_MAX * 10); /* Send HTTP request */ diff --git a/plugins/out_azure_kusto/azure_kusto_ingest.c b/plugins/out_azure_kusto/azure_kusto_ingest.c index a5dedf2f8e1..be03d7610ee 100644 --- a/plugins/out_azure_kusto/azure_kusto_ingest.c +++ b/plugins/out_azure_kusto/azure_kusto_ingest.c @@ -166,7 +166,7 @@ static flb_sds_t azure_kusto_create_blob(struct flb_azure_kusto *ctx, flb_sds_t 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-user", 9, "Kusto.Fluent-Bit", 16); 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); @@ -375,7 +375,7 @@ static int azure_kusto_enqueue_ingestion(struct flb_azure_kusto *ctx, flb_sds_t 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-user", 9, "Kusto.Fluent-Bit", 16); 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); From 72c4b9d5e20088cb8bcf4a749774d65b15657c18 Mon Sep 17 00:00:00 2001 From: Tanmaya Panda Date: Mon, 12 Feb 2024 19:59:26 +0530 Subject: [PATCH 4/4] removed generate_uuid Signed-off-by: Tanmaya Panda --- plugins/out_azure_kusto/azure_kusto.c | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/out_azure_kusto/azure_kusto.c b/plugins/out_azure_kusto/azure_kusto.c index 0b6a23e8b1d..b04c86a6578 100644 --- a/plugins/out_azure_kusto/azure_kusto.c +++ b/plugins/out_azure_kusto/azure_kusto.c @@ -156,7 +156,6 @@ flb_sds_t execute_ingest_csl_command(struct flb_azure_kusto *ctx, const char *cs /* added kusto specific headers for debugging requests */ flb_http_add_header(c, "x-ms-user", 9, "Kusto.Fluent-Bit", 16); - 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);