Skip to content

Commit

Permalink
out_splunk: remove raw endpoint
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
pmeier committed Jun 25, 2024
1 parent fe988b1 commit b83bda1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
11 changes: 1 addition & 10 deletions plugins/out_splunk/splunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
Expand Down
3 changes: 1 addition & 2 deletions plugins/out_splunk/splunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit b83bda1

Please sign in to comment.