diff --git a/plugins/out_logdna/logdna.c b/plugins/out_logdna/logdna.c index 88a0fc9814d..bc834c6017d 100644 --- a/plugins/out_logdna/logdna.c +++ b/plugins/out_logdna/logdna.c @@ -405,7 +405,8 @@ static void cb_logdna_flush(struct flb_event_chunk *event_chunk, FLB_OUTPUT_RETURN(FLB_RETRY); } tmp = flb_sds_printf(&uri, - "/logs/ingest?hostname=%s&mac=%s&ip=%s&now=%lu&tags=%s", + "%s?hostname=%s&mac=%s&ip=%s&now=%lu&tags=%s", + ctx->logdna_endpoint, ctx->_hostname, ctx->mac_addr, ctx->ip_addr, @@ -532,6 +533,12 @@ static struct flb_config_map config_map[] = { "LogDNA TCP port" }, + { + FLB_CONFIG_MAP_STR, "logdna_endpoint", FLB_LOGDNA_ENDPOINT, + 0, FLB_TRUE, offsetof(struct flb_logdna, logdna_endpoint), + "LogDNA endpoint to send logs" + }, + { FLB_CONFIG_MAP_STR, "api_key", NULL, 0, FLB_TRUE, offsetof(struct flb_logdna, api_key), diff --git a/plugins/out_logdna/logdna.h b/plugins/out_logdna/logdna.h index b2b3a8f3d5b..b906e2563c4 100644 --- a/plugins/out_logdna/logdna.h +++ b/plugins/out_logdna/logdna.h @@ -25,6 +25,7 @@ #define FLB_LOGDNA_HOST "logs.logdna.com" #define FLB_LOGDNA_PORT "443" +#define FLB_LOGDNA_ENDPOINT "/logs/ingest" #define FLB_LOGDNA_CT "Content-Type" #define FLB_LOGDNA_CT_JSON "application/json; charset=UTF-8" @@ -32,6 +33,7 @@ struct flb_logdna { /* Incoming Configuration Properties */ flb_sds_t logdna_host; int logdna_port; + flb_sds_t logdna_endpoint; flb_sds_t api_key; flb_sds_t hostname; flb_sds_t mac_addr;