Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in_splunk: Store HEC token on enabled HTTP2 and raw endpoints #8883

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions plugins/in_splunk/splunk_prot.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,10 @@ static int process_hec_raw_payload_ng(struct flb_http_request *request,
flb_sds_t tag,
struct flb_splunk *ctx)
{
int ret = 0;
size_t size = 0;
char *auth_header;

if (request->content_type == NULL) {
send_response_ng(response, 400, "error: header 'Content-Type' is not set\n");

Expand All @@ -971,6 +975,11 @@ static int process_hec_raw_payload_ng(struct flb_http_request *request,
flb_plg_debug(ctx->ins, "Mark as unknown type for ingested payloads");
}

ret = flb_hash_table_get(request->headers, "authorization", 13, (void **)&auth_header, &size);
if (ret != 0) {
ctx->ingested_auth_header = auth_header;
}

if (request->body == NULL || cfl_sds_len(request->body) == 0) {
send_response_ng(response, 400, "error: no payload found\n");

Expand Down
Loading