From b83bda1c068b3b9af9459e4816ab3f0cfcb21989 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Tue, 25 Jun 2024 13:06:07 +0200 Subject: [PATCH] out_splunk: remove raw endpoint Fixes #8927. This does **not** remove the ability to send raw events, i.e. using `Splunk_Send_Raw On`, but rather sends them to correct endpoint. Signed-off-by: Philip Meier --- plugins/out_splunk/splunk.c | 11 +---------- plugins/out_splunk/splunk.h | 3 +-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/plugins/out_splunk/splunk.c b/plugins/out_splunk/splunk.c index 4ec93aff477..a928f52843b 100644 --- a/plugins/out_splunk/splunk.c +++ b/plugins/out_splunk/splunk.c @@ -628,7 +628,6 @@ static void cb_splunk_flush(struct flb_event_chunk *event_chunk, flb_sds_t buf_data; size_t resp_size; size_t buf_size; - char *endpoint; struct flb_splunk *ctx = out_context; struct flb_connection *u_conn; struct flb_http_client *c; @@ -687,16 +686,8 @@ static void cb_splunk_flush(struct flb_event_chunk *event_chunk, } } - /* Splunk URI endpoint */ - if (ctx->splunk_send_raw) { - endpoint = FLB_SPLUNK_DEFAULT_URI_RAW; - } - else { - endpoint = FLB_SPLUNK_DEFAULT_URI_EVENT; - } - /* Compose HTTP Client request */ - c = flb_http_client(u_conn, FLB_HTTP_POST, endpoint, + c = flb_http_client(u_conn, FLB_HTTP_POST, FLB_SPLUNK_DEFAULT_ENDPOINT, payload_buf, payload_size, NULL, 0, NULL, 0); /* HTTP Response buffer size, honor value set by the user */ diff --git a/plugins/out_splunk/splunk.h b/plugins/out_splunk/splunk.h index 4c71a0ec356..f86d918327b 100644 --- a/plugins/out_splunk/splunk.h +++ b/plugins/out_splunk/splunk.h @@ -22,8 +22,7 @@ #define FLB_SPLUNK_DEFAULT_HOST "127.0.0.1" #define FLB_SPLUNK_DEFAULT_PORT 8088 -#define FLB_SPLUNK_DEFAULT_URI_RAW "/services/collector/raw" -#define FLB_SPLUNK_DEFAULT_URI_EVENT "/services/collector/event" +#define FLB_SPLUNK_DEFAULT_ENDPOINT "/services/collector/event" #define FLB_SPLUNK_DEFAULT_TIME "time" #define FLB_SPLUNK_DEFAULT_EVENT_HOST "host" #define FLB_SPLUNK_DEFAULT_EVENT_SOURCE "source"