diff --git a/plugins/out_azure_kusto/azure_kusto.c b/plugins/out_azure_kusto/azure_kusto.c index 58ac559dbdc..c0f4987d580 100644 --- a/plugins/out_azure_kusto/azure_kusto.c +++ b/plugins/out_azure_kusto/azure_kusto.c @@ -126,6 +126,9 @@ flb_sds_t execute_ingest_csl_command(struct flb_azure_kusto *ctx, const char *cs struct flb_http_client *c; flb_sds_t resp = NULL; + /* setting default connection timeout to kusto ingest endpoint */ + ctx->u->base.net.connect_timeout = ctx->kusto_endpoint_connection_timeout; + /* Get upstream connection */ u_conn = flb_upstream_conn_get(ctx->u); @@ -462,6 +465,9 @@ static struct flb_config_map config_map[] = { offsetof(struct flb_azure_kusto, time_key), "The key name of the time. If 'include_time_key' is false, " "This property is ignored"}, + {FLB_CONFIG_MAP_TIME, "kusto_endpoint_connection_timeout", FLB_AZURE_KUSTO_INGEST_ENDPOINT_CONNECTION_TIMEOUT, 0, FLB_TRUE, + offsetof(struct flb_azure_kusto, kusto_endpoint_connection_timeout), + "Set the connection timeout of various kusto endpoints (kusto ingest endpoint, kusto ingestion blob endpoint, kusto ingestion blob endpoint) in seconds"}, /* EOF */ {0}}; diff --git a/plugins/out_azure_kusto/azure_kusto.h b/plugins/out_azure_kusto/azure_kusto.h index b752e087e65..996f59e4a73 100644 --- a/plugins/out_azure_kusto/azure_kusto.h +++ b/plugins/out_azure_kusto/azure_kusto.h @@ -51,6 +51,8 @@ #define FLB_AZURE_KUSTO_RESOURCES_LOAD_INTERVAL_SEC 3600 +#define FLB_AZURE_KUSTO_INGEST_ENDPOINT_CONNECTION_TIMEOUT "60" + struct flb_azure_kusto_resources { struct flb_upstream_ha *blob_ha; struct flb_upstream_ha *queue_ha; @@ -70,6 +72,9 @@ struct flb_azure_kusto { flb_sds_t table_name; flb_sds_t ingestion_mapping_reference; + /* connection configuration */ + int kusto_endpoint_connection_timeout; + /* records configuration */ flb_sds_t log_key; int include_tag_key; diff --git a/plugins/out_azure_kusto/azure_kusto_ingest.c b/plugins/out_azure_kusto/azure_kusto_ingest.c index 41c37308dc1..6e901e5b6e0 100644 --- a/plugins/out_azure_kusto/azure_kusto_ingest.c +++ b/plugins/out_azure_kusto/azure_kusto_ingest.c @@ -147,6 +147,9 @@ static flb_sds_t azure_kusto_create_blob(struct flb_azure_kusto *ctx, flb_sds_t return NULL; } + /* setting default connection timeout to kusto azure blob endpoint */ + ctx->u->base.net.connect_timeout = ctx->kusto_endpoint_connection_timeout; + u_conn = flb_upstream_conn_get(u_node->u); if (u_conn) { @@ -348,6 +351,9 @@ static int azure_kusto_enqueue_ingestion(struct flb_azure_kusto *ctx, flb_sds_t return -1; } + /* setting default connection timeout to kusto azure queue endpoint */ + ctx->u->base.net.connect_timeout = ctx->kusto_endpoint_connection_timeout; + u_conn = flb_upstream_conn_get(u_node->u); if (u_conn) {