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

fix: splunk output plugin correct record accessor key for hec_token #8793

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions plugins/out_splunk/splunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,9 @@ static flb_sds_t extract_hec_token(struct flb_splunk *ctx, msgpack_object map,
flb_sds_t hec_token;

/* Extract HEC token (map which is from metadata lookup) */
if (ctx->event_sourcetype_key) {
hec_token = flb_ra_translate(ctx->ra_metadata_auth_key, tag, tag_len,
map, NULL);
if (ctx->metadata_auth_key) {
hec_token = flb_ra_translate_check(ctx->ra_metadata_auth_key, tag, tag_len,
map, NULL, FLB_TRUE);
if (hec_token) {
return hec_token;
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/out_splunk/splunk_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ struct flb_splunk *flb_splunk_conf_create(struct flb_output_instance *ins,
}

/* Currently, Splunk HEC token is stored in a fixed key, hec_token. */
ctx->metadata_auth_key = "hec_token";
ctx->metadata_auth_key = "$hec_token";
if (ctx->metadata_auth_key) {
ctx->ra_metadata_auth_key = flb_ra_create(ctx->metadata_auth_key, FLB_TRUE);
if (!ctx->ra_metadata_auth_key) {
Expand Down
Loading